Skip to content

Commit 84435a9

Browse files
committed
more like a sunflower
1 parent a4aef5c commit 84435a9

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

fermat_spiral/fermat_spiral.pde

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import processing.svg.*;
33
int _numPoints = 450;
44
float _angle = 137.5;
55
float _scale = 10;
6-
float _seedSize = 10;
6+
float _seedSize = 20;
77

88

99
void setup() {
@@ -18,12 +18,18 @@ void draw() {
1818
for(int n=0; n<_numPoints; n++) {
1919
float theta = n * radians(_angle);
2020
float radius = sqrt(n) * _scale;
21-
float x = radius * cos(theta) + width/2;
22-
float y = radius * sin(theta) + height/2;
21+
float translateX = radius * cos(theta) + width/2;
22+
float translateY = radius * sin(theta) + height/2;
2323

24-
float size = (n / 60) + _seedSize * 1.5;
25-
//float size = _seedSize;
24+
float x = 0;
25+
float y = 0;
26+
27+
float size = (n / 42) + _seedSize;
2628

27-
ellipse(x, y, size, size);
29+
pushMatrix();
30+
translate(translateX, translateY);
31+
rotate(theta);
32+
quad(x, y+size/4, x+size/2, y, x+size, y+size/4, x+size/2, y+ size/2);
33+
popMatrix();
2834
}
2935
}

0 commit comments

Comments
 (0)