function setup(){
createCanvas(windowWidth,windowHeight);
angleMode(DEGREES);
noFill()
r=min(width,height)/3
}
function draw(){
background(255,255,255)
a=frameCount/4
translate(width/2,height/2);
text("(cos(θ), sin(θ), tan(θ))",-width/2+20,-height/2+20)
axes()
circle(0,0,2*r)
mLine(a)
}
function axes(){
stroke(0)
strokeWeight(2)
line(0,-height,0,height);
line(-width,0,width,0);
line()
strokeWeight(0.1)
for(let i = 0;i<72;i++){
push()
rotate(i*5)
line(-width,0,width,0);
pop()
}
strokeWeight(2)
}
function mLine(a){
strokeWeight(3)
stroke(20,100,200);
line(0,0,r*cos(a),-r*sin(a))
line(r*cos(a),-r*sin(a),0,-r*sin(a))
line(r*cos(a),-r*sin(a),r*cos(a),0)
tmp="("+str(round(cos(a),2))+", "+ str(round(sin(a),2)) + ", "+ str(round(sin(a),2))+")"
stroke(0)
strokeWeight(1)
fill(0)
textSize(12)
translate((r+40)*cos(a)-30,(r+40)*sin(-a))
text(tmp,0,0);
noFill()
}