# Line first coordinate is allways (0,0)

**URL:** https://discourse.processing.org/t/line-first-coordinate-is-allways-0-0/11942
**Category:** Coding Questions
**Created:** [June 9, 2019, 1:47pm UTC](https://discourse.processing.org/t/line-first-coordinate-is-allways-0-0/11942 "2019-06-09T13:47:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BallazX](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@BallazX](https://discourse.processing.org/u/BallazX)
#### Post date: [June 9, 2019, 1:47pm UTC](https://discourse.processing.org/t/line-first-coordinate-is-allways-0-0/11942/1 "2019-06-09T13:47:58Z")

</div>

Hey All,

I would like to draw some lines:

```auto
void setup() {
  size(600, 600);
  noLoop();
}
void draw(){
  line(pmouseX, pmouseY, mouseX, mouseY);
}
void mouseClicked() {
  redraw();
}

```

My problem is, that the first line always starts from the 0,0. Is there any solution to give start it not from the origin?  
 ![cut](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e0cf2da1ca3207c75c5ec62ce0f14a998133b755.png)

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [June 9, 2019, 2:16pm UTC](https://discourse.processing.org/t/line-first-coordinate-is-allways-0-0/11942/2 "2019-06-09T14:16:35Z")

</div>

You can have a variable boolean firstTime and when it’s true

set it to false and make a line from the origin

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [June 9, 2019, 2:34pm UTC](https://discourse.processing.org/t/line-first-coordinate-is-allways-0-0/11942/3 "2019-06-09T14:34:37Z")

</div>

```auto
void setup() {
  size(600, 600);
  noLoop();
}

void draw() {
  if (frameCount <= 2) return;
  line(pmouseX, pmouseY, mouseX, mouseY);
}

void mousePressed() {
  redraw();
}

```
