Last active
April 30, 2020 19:37
-
-
Save georgesb/cb4238c5077c31583fff33e46770aa6e to your computer and use it in GitHub Desktop.
Golden Ratio 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.jsdelivr.net/npm/p5"></script> | |
<script src="script.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
createCanvas(650, 450); | |
background(255, 170, 0, 95); | |
noStroke(); | |
fill(30, 70); | |
let x = width / 2 + 182; | |
let y = height / 2; | |
let size = 8; | |
let phi = 1.618; | |
for (let i = 1; i <= 8; i++) { | |
size *= phi; | |
x = x - size / 5.3; | |
circle(x, y, size); | |
} | |
x = width / 2 - 182; | |
y = height / 2; | |
size = 8; | |
for (let i = 1; i <= 8; i++) { | |
size *= phi; | |
x = x + size / 5.3; | |
circle(x, y, size); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment