# How to make curves with slight variations

**URL:** <https://discourse.processing.org/t/how-to-make-curves-with-slight-variations/8745>\
**Category:** Coding Questions\
**Created:** [February 26, 2019, 6:57pm UTC](https://discourse.processing.org/t/how-to-make-curves-with-slight-variations/8745 "2019-02-26T18:57:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blkpanther](https://avatars.discourse-cdn.com/v4/letter/b/d9b06d/32.png) [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Post date:** [February 26, 2019, 6:57pm UTC](https://discourse.processing.org/t/how-to-make-curves-with-slight-variations/8745/1 "2019-02-26T18:57:43Z")

</div>

I intend to make arrays of curves that line up like this.

 ![48%20PM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e209e00d75e2e3e1725b03a0497c92e2051596ee.png)  
So far my code can only draw straight lines like this or relatively regular curves  
 ![00%20PM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a3ad74745e0c6c973e66eb62610d91ab4a497d07.png)  
I wonder how to use curve functions to create an array of curves that doesn’t cross over yet has slight variation so they don’t look identical, and how to adjust the size of the object.

My current code below:

```auto
let t=5;
function setup() {
    createCanvas(600, 600);

}

function draw() {
    background(255);
    translate(0,50);
    noFill();
    for (let i=0;i<100;i++){
    translate(t, 0.1);
    bezier(0,258,50,199,50,209,100,186);
    bezier(0,258,50,300,50,269,100,306);
    push ();
    rotate (radians(30));
    line (0,0,random(50,90),0);
    rotate (radians(-60));
    line (0,0,random(50,90),0);
    pop();
}
noLoop();
}

```

Thanks!

---

<div class="post-metadata">

**Author:** ![scudly](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/scudly/32/5597_2.png) [@scudly](https://discourse.processing.org/u/scudly)\
**Post date:** [February 26, 2019, 9:27pm UTC](https://discourse.processing.org/t/how-to-make-curves-with-slight-variations/8745/2 "2019-02-26T21:27:20Z")

</div>

It would be easier, though might have a bit less variation, to use arc(). Give them different ending angles, but all the same or similar radiuses and then they won’t overlap.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 28, 2019, 6:28pm UTC](https://discourse.processing.org/t/how-to-make-curves-with-slight-variations/8745/3 "2019-02-28T18:28:29Z")

</div>

If you want arcs nearby one another to be curved in similar (yet different) ways – “naturally” – then you should use `noise()` rather than `random()` and perhaps look at configuring your `noiseSeed()`.

Note that you could use curve / curvePoint (or bezierPoint) for vertex components.
