xxxxxxxxxx
30
// personal challenge to learn how to make spiral
// https://en.wikipedia.org/wiki/Archimedean_spiral
let slider;
function setup(){
createCanvas(400, 400);
// background(0);
angleMode(DEGREES);
slider = createSlider(-10, 10, 0.5, 0.01);
}
function draw() {
background(50);
let a = 1.5;
let b = slider.value();
stroke(255);
noFill();
translate(width/2, height/2);
beginShape();
for (let i = 0; i < 360*2; i ++) {
//let t = seq(0,5*pi, length.out=500);
let x = (a + b*i) * cos(i);
let y = (a + b*i) * sin(i);
vertex(x, y);
}
endShape();
}