# Organic Random Lines

**URL:** <https://discourse.processing.org/t/organic-random-lines/30748>\
**Category:** Coding Questions\
**Created:** [June 16, 2021, 8:36pm UTC](https://discourse.processing.org/t/organic-random-lines/30748 "2021-06-16T20:36:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [June 16, 2021, 8:36pm UTC](https://discourse.processing.org/t/organic-random-lines/30748/1 "2021-06-16T20:36:57Z")

</div>

Hi there! I am trying to draw organic lines, so I have started making that kind of oscillations that you can see on black line. I don’t know if that can be done easier, but is was the only possible way for my beguinner level. The problem is this, that way does not work when I try to draw a random line, the red one. Do you know how can I draw more natural lines in other way? Thank you so much!

```auto
void setup() {
  size(1000, 1000);
  background(255,255,255);
  smooth(10);
  
  
  stroke(0);
  strokeWeight(9);  
  line(100,500,222,490);
  line(222,490,310,505);
  line(310,505,330,495);
  line(330,495,340,505);
  line(340,505,400,490);
  line(400,490,520,510);
  line(520,510,540,495);
  line(540,495,550,490);
  line(550,490,680,500);
  line(680,500,800,505);
  line(800,505,900,500);
  
  
  stroke(255,0,0);
  strokeWeight(9);
  float x1 = random(0,1000);
  float y1 = random(0,1000);
  float x2 = random(0,1000);
  float y2 = random(0,1000);
  
  line(x1,y1,x2,y2);
  
  
  
  }
   

```

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 16, 2021, 8:55pm UTC](https://discourse.processing.org/t/organic-random-lines/30748/2 "2021-06-16T20:55:19Z")

</div>

Hello,

Take a look here:

[https://processing.org/reference/noise\_.html](https://processing.org/reference/noise_.html)

[https://processing.org/examples/noisewave.html[https://processing.org/examples/noisewave.html](https://processing.org/examples/noisewave.html)](https://processing.org/examples/noisewave.html%5Bhttps://processing.org/examples/noisewave.html%5D(https://processing.org/examples/noisewave.html))

[YouTube I.5: Perlin Noise - The Nature of Code](https://www.youtube.com/watch?v=8ZEMLCnn8v0)

`:)`

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [June 16, 2021, 10:53pm UTC](https://discourse.processing.org/t/organic-random-lines/30748/3 "2021-06-16T22:53:34Z")

</div>

I have tried with noise as you have told me, but I don’t understand nothing at all. Maybe I have to start with easier questions. I have tried yo make a line between 2 random points, introducing one between them with a variation. I can repeat that sometimes to make more organic lines. I Will work on this and I Will Come back here to try noise function again later.

```auto
void setup() {
  size(600, 600);
  background(255,255,255);
  strokeWeight(10);
  
  float x1 = random(0, 600);
  float y1 = random(0, 600);
  float x2 = random(0, 600);
  float y2 = random(0, 600);
  float a = random(x1,x2);
  float b = random(y1,y1);
  
  
  
  beginShape();
  vertex(x1,y1);
  vertex(a,b);
  vertex(x2,y2);
  endShape();
  }

```
