Skip to content

Instantly share code, notes, and snippets.

@georgesb
Last active May 2, 2020 06:36
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/9bd4cf42d16bdc9fc05840fc65a77b55 to your computer and use it in GitHub Desktop.
Save georgesb/9bd4cf42d16bdc9fc05840fc65a77b55 to your computer and use it in GitHub Desktop.
Golden Ratio 5
<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);
fill(120);
noStroke();
let fibonacci = [1, 2, 3, 5, 8, 13, 21];
translate(50, 100);
for (let i = 6; i >= 0; i--) {
x = fibonacci[i] * 10;
y = x;
ellipse(0, 0, x, y);
translate(x, y);
rotate(radians(-45));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment