xxxxxxxxxx
28
let radius;
let angle;
var step; //distance between steps in radians
let randomColor;
let lineLength = 20;
function setup() {
distance = 40; // Distance from the centerpoint
angle = 0; // Current angle around circle
step = TWO_PI / 60; // How many steps around circle
}
function draw() {
// Make the center of the screen the new (0, 0)
translate(width / 2, height / 2);
// Convert polar coordinates to cartesian coordinates
var x = distance * sin(angle);
var y = distance * cos(angle);
// Draw line so it is "pointed" from the center
// It starts on the outside, and draws "inward"
line(x - sin(angle)*lineLength, y - cos(angle)*lineLength, x, y);
// Move to next angle
angle = angle + step;
}