# Easy question from new user! +Parallel lines drawing

**URL:** https://discourse.processing.org/t/easy-question-from-new-user-parallel-lines-drawing/21464
**Category:** Coding Questions
**Created:** [May 31, 2020, 10:26pm UTC](https://discourse.processing.org/t/easy-question-from-new-user-parallel-lines-drawing/21464 "2020-05-31T22:26:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ateroma](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@Ateroma](https://discourse.processing.org/u/Ateroma)
#### Post date: [May 31, 2020, 10:26pm UTC](https://discourse.processing.org/t/easy-question-from-new-user-parallel-lines-drawing/21464/1 "2020-05-31T22:26:17Z")

</div>

Hello!

I’m new here and I just found this incredible software during the quarantine.

I’m reading the Processing: A Programming Handbook for Visual Designers and Artists book for learning, but I remained stuck while trying to do an exercise/experiment/design/etc drawing a few lines…

The code i’m using right now is this one:

```auto
size(800, 800);

strokeWeight(2);
for (int x = 5; x < 800; x += 7) {
float n = map(x, 5, 795, -1, 1);
float p = pow(n, 3);
float ypos = lerp(400, 800, p);
line(x, 0, x, ypos);
}
for (int x = 5; x < 800; x += 10) {
float n = map(x, 5, 795, -1, 1);
float p = pow(n, 3);
float ypos = lerp(400, 800, p);
m += 8;
line(-ypos*500,ypos*300, x,ypos);
}

```

and this is what I get

![curvas1 copia](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/042bc04eaea71977197151a9b165f9a7925e000f.png)

What I’m looking for is that the oblique?diagonal?stripes to have the same separation between them and not to be in function of the ypos variable, at the same time it keeps the shape it has now and not overlapping with the vertical stripes.

I tried everything and thats why I come here to ask you… I’ve accomplished to keep the separation between them but losing the shape or even worse things…

Sorry if I explain myself bad… English is not my native language.

Thanks!

---

<div class="post-metadata">

### Author: ![slow\_izzm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/slow_izzm/32/5637_2.png) [@slow\_izzm](https://discourse.processing.org/u/slow_izzm)
#### Post date: [June 1, 2020, 6:23pm UTC](https://discourse.processing.org/t/easy-question-from-new-user-parallel-lines-drawing/21464/2 "2020-06-01T18:23:18Z")

</div>

On your second for loop, set the increment to `x+=7`, same as the first for loop …

btw … you can move `line(-ypos * 500, ypos * 300, x, ypos);` into the first for loop and remove the other loop altogether.
