Last active
May 2, 2020 06:37
-
-
Save georgesb/1e6b80e675c089bea1c331d10d7712fb to your computer and use it in GitHub Desktop.
Golden Ratio 4
This file contains 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 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() { | |
let x, y; | |
createCanvas(650, 450); | |
background('#fafafa'); | |
ellipseMode(CORNER); | |
noFill(); | |
let fibonacci = [1, 1, 2, 3, 5, 8, 13, 21]; | |
translate(50, 50); | |
for (let i = 7; i >= 0; i--) { | |
x = fibonacci[i] * 15; | |
y = x; | |
rect(0, 0, x, y); | |
ellipse(0, 0, x, y); | |
translate(x, y); | |
rotate(radians(270)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment