Skip to content

Commit 0ecea40

Browse files
committed
cleaned makeFlowers
1 parent 379898e commit 0ecea40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/secrets.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ for (var f in flowers) {
5656
}
5757

5858

59-
function roseMath(v, k, t) {
59+
function roseMath(radius, v, k, t) {
6060
v.x = radius * Math.cos(k * t) * Math.cos(t);
6161
v.y = radius * Math.cos(k * t) * Math.sin(t);
6262
return v;
6363
}
6464

65-
function makeFlowers() {
65+
function makeFlowers(radius) {
6666
var flowers = [];
6767
var resolution = 240; // every flower has 240 points
68-
for (var k = 4; k < 20; k++) {
68+
for (var k = 4; k < 24; k++) {
6969
var points = [];
7070
for (var j = 0; j < resolution; j++) {
7171
points[j] = new Two.Anchor();
72-
roseMath(points[j], k, Math.PI * 2 * j / resolution);
72+
roseMath(radius, points[j], k, Math.PI * 2 * j / resolution);
7373
}
7474
// Create shape
7575
var flower = new Two.Path(points, true, true);

0 commit comments

Comments
 (0)