-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
40 lines (34 loc) · 844 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Created by GeekStar Codes */
var points = 200;
var radius;
var factor = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
radius = width / 2 - 15;
}
function findPoints(num) {
var angle = map(num, 0, points, 0, PI * 2);
var x = radius * cos(angle - PI);
var y = radius * sin(angle - PI);
var vec = createVector(x, y);
return vec;
}
function draw() {
background(0);
factor += 0.005;
translate(width / 2, height / 2);
stroke(23, 255, 50);
strokeWeight(1);
noFill();
circle(0, 0, radius * 2);
for (var i = 0; i < points; i++) {
var a = findPoints(i);
var b = findPoints(i * factor);
line(a.x, a.y, b.x, b.y);
}
}
/* Created by GeekStar Codes */
/*
Subscribe to my YouTube channel for more cool stuffs.
Link: https://t2m.io/pXUSmgPx
*/