xxxxxxxxxx
44
function setup() {
createCanvas(windowWidth, windowWidth);
angleMode(DEGREES);
theta = 3800;
rotSpeed = 1;
numPoints = 32;
colorMode(HSB, 100);
strokeWeight(2);
frameRate(2);
}
function draw() {
//noLoop();
background(0);
scale(0.25);
x = y = dx = dy = lastX = lastY = angle = high = 0;
for (let i = 0; i < numPoints-20; i++) {
r = angle;
x = width<<1;
y = height<<1;
dx = r * cos(angle);
dy = r * sin(angle);
//z = r * tan(angle);
if (r > high) {
high = r;
}
stroke(map(r, 0, high, 0, 100), 100, 100);
line(x + lastX, y + lastY, x + dx, y + dy);
lastX = dx;
lastY = dy;
angle += theta / numPoints;
// if(angle>=9000){noLoop();}
//angle++;
}
print(angle);
theta += rotSpeed;
}
function keyPressed() {
if (keyCode === 32) {
print(angle);
}
}