xxxxxxxxxx
// offset determines the location of the spiral
float offsetX, offsetY;
float angle = 0.0;
float scalar = 2;
float speed = 0.05;
void setup() {
size(500, 500);
stroke(242, 47, 12, 30);
fill(242, 47, 12, 30);
background(255);
offsetX = width/2;
offsetY = height/2;
smooth();
}
void draw() {
// draws the spiral
float x = offsetX + cos(angle) * scalar;
float y = offsetY + sin(angle) * scalar;
ellipse(x, y, 2, 2);
angle += speed;
scalar += speed;
}