OL_HeringIllusion
r=300
n=40;
function setup() {
createCanvas(400, 400);//create the canvas
stroke(0,0,100)
}
function draw() {
translate(200,200)
for(let i=0;i<n;i++){
if(i>2&&i<n-2) line(r*sin(PI/n*i),r*cos(PI/n*i),r*sin(PI/n*i+PI),r*cos(PI/n*i+PI));//Activity: Try to rewrite this code using slope instead of a rotation
}
strokeWeight(2)
stroke(200,0,0)
line(-50,-400,-50,400)
line(50,-400,50,400)
noLoop();
}