Skip to content

Instantly share code, notes, and snippets.

@georgesb
Last active May 2, 2020 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgesb/1e6b80e675c089bea1c331d10d7712fb to your computer and use it in GitHub Desktop.
Save georgesb/1e6b80e675c089bea1c331d10d7712fb to your computer and use it in GitHub Desktop.
Golden Ratio 4
<script src="https://cdn.jsdelivr.net/npm/p5"></script>
<script src="script.js"></script>
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