Skip to content

Instantly share code, notes, and snippets.

@JohnPhamous
Last active April 25, 2020 18:59
Show Gist options
  • Select an option

  • Save JohnPhamous/b5f28b72db44741eb5be512fc338d8f5 to your computer and use it in GitHub Desktop.

Select an option

Save JohnPhamous/b5f28b72db44741eb5be512fc338d8f5 to your computer and use it in GitHub Desktop.

Revisions

  1. JohnPhamous revised this gist Apr 25, 2020. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion draw.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    let itter = 10000;
    let itter = 1;
    let max_itter = 10000;
    let offset = 0;
    let width = 800;
    let height = 800;
    @@ -23,4 +24,12 @@ function draw() {
    let decay = exp(-pow(d / 100, 2)) / sin(d);
    ellipse(x, y, decay * 10);
    }

    let candi = itter + itter;
    if (candi > max_itter) {
    itter = max_itter;
    }
    else {
    itter = candi;
    }
    }
  2. JohnPhamous revised this gist Apr 25, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion draw.js
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,8 @@ let foregroundColor = "#fca311";
    function setup() {
    pixelDensity(2);
    createCanvas(width, height);
    noLoop();
    // noLoop();
    frameRate(5);
    }

    function draw() {
  3. JohnPhamous created this gist Apr 25, 2020.
    25 changes: 25 additions & 0 deletions draw.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    let itter = 10000;
    let offset = 0;
    let width = 800;
    let height = 800;
    let backgroundColor = "#14213d";
    let foregroundColor = "#fca311";

    function setup() {
    pixelDensity(2);
    createCanvas(width, height);
    noLoop();
    }

    function draw() {
    background(backgroundColor);
    fill(backgroundColor);
    stroke(foregroundColor);
    for (let i = 0; i < itter; i++) {
    let x = random(offset, width - offset);
    let y = random(offset, height - offset);
    let d = dist(width / 2, height / 2, x, y);
    let decay = exp(-pow(d / 100, 2)) / sin(d);
    ellipse(x, y, decay * 10);
    }
    }