# Help with noise

**URL:** <https://discourse.processing.org/t/help-with-noise/45315>\
**Category:** Coding Questions\
**Created:** [November 10, 2024, 12:56pm UTC](https://discourse.processing.org/t/help-with-noise/45315 "2024-11-10T12:56:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stoli](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Stoli](https://discourse.processing.org/u/Stoli)\
**Post date:** [November 10, 2024, 12:56pm UTC](https://discourse.processing.org/t/help-with-noise/45315/1 "2024-11-10T12:56:36Z")

</div>

I found this image and it looks like it was generated using noise.

 ![noise1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/8/b803399e5ef3491ada2fba2b692e8dc0f7a792b5.png)

I’ve tried a bunch of different variations on the noise() function and have come up with some very interesting images but can’t seem to achieve anything close. Here is where I am at:

[tried to upload the image that my code created but noob is limited to one image per post??? See next post for the image]

but here is the code

```auto
var centerX;
var centerY;
var radius;
var totalDegrees = 369;
var maxFrames = 180;

function setup() {
    createCanvas(
        window.innerWidth,
        window.innerHeight
    );
    background(255);
    centerX = width / 2;
    centerY = height / 2;
    radius = 25;
    angleMode(DEGREES);
    translateX = 0;
    translateY = 0;
    opacity = 255;
}

function draw() {
    if (frameCount > maxFrames) {
        noLoop();
    }
    noFill();
    stroke(0, 0, 0, 255);
    beginShape();
        for (let i=0; i <=totalDegrees; i++) {
            var noiseFactor = noise(i / 40, frameCount / 50 * (frameCount + 40)/maxFrames);
            var x = centerX + radius * cos(i) * noiseFactor;
            var y = centerY + radius * sin(i) * noiseFactor;
            vertex(x, y);
        }
    endShape(CLOSE);
    radius += 2;
}

```

Was hoping someone could give me a nudge in the right direction.

Thanks

---

<div class="post-metadata">

**Author:** ![Stoli](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Stoli](https://discourse.processing.org/u/Stoli)\
**Post date:** [November 10, 2024, 12:58pm UTC](https://discourse.processing.org/t/help-with-noise/45315/2 "2024-11-10T12:58:33Z")

</div>

Here is one of the images that the code in my original post created

 ![noise2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/3/7365916784997dd1e82f79a3ce6824681c03bfab.png)

Thanks

---

<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:** [November 10, 2024, 1:32pm UTC](https://discourse.processing.org/t/help-with-noise/45315/3 "2024-11-10T13:32:04Z")

</div>

Hello @Stoli,

I tried `strokeWeight(.4)` and got this:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/6/468bcb71d2e834778d4f1c7c280c2e630aaa29c8.jpeg)

Starts with a circle and add noise to it:

```auto
    beginShape();
        for (let i=0; i <=totalDegrees; i++) {
            var noiseFactor = noise(i / 40, frameCount / 50 * (frameCount + 40)/maxFrames);
            var x = width/2 + 50*cos(i) + radius* cos(i)*noiseFactor;
            var y = height/2 + 50*sin(i) + radius* sin(i)*noiseFactor;
            vertex(x, y);
        }
    endShape(CLOSE);

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/5/e56e9f248aee96c18b871d46e0eb492533a204b3.jpeg)

It is more prominent now where the overlap is!  
Keep working at it!

`:)`

---

<div class="post-metadata">

**Author:** ![Stoli](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Stoli](https://discourse.processing.org/u/Stoli)\
**Post date:** [November 10, 2024, 4:54pm UTC](https://discourse.processing.org/t/help-with-noise/45315/4 "2024-11-10T16:54:38Z")

</div>

Thanks! That’s certainly a step in the right direction. It occurs to me that the relationship of noise to radius is maybe not linear but exponential. I think I’ll head down that road.

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [November 11, 2024, 6:51am UTC](https://discourse.processing.org/t/help-with-noise/45315/5 "2024-11-11T06:51:18Z")

</div>

Crossposting [https://www.reddit.com/r/p5js/s/4NG2U03qH9](https://www.reddit.com/r/p5js/s/4NG2U03qH9)  
(Nothing is wrong about it but make sure you add a link as a reference 🤖)

---

<div class="post-metadata">

**Author:** ![Stoli](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Stoli](https://discourse.processing.org/u/Stoli)\
**Post date:** [November 13, 2024, 6:47pm UTC](https://discourse.processing.org/t/help-with-noise/45315/6 "2024-11-13T18:47:41Z")

</div>

I think I figured it out. For more info, go to the crosspost at reddit (link in previous post)
