Sharedfirst_steps / InClass / Trigonometry.sagewsOpen in CoCalc

The limit of sides regular convex polygon is a circle when approaches to infinity.

@interact
def _(n=slider(int(3),int(20),1,default=int(3),label='The number of the corners $=$')):
n=int(n)
p1=circle((0,0),1,color='black')
corner=[[cos(2*i*pi/n),sin(2*i*pi/n)] for i in range(n)]
p2=polygon2d(corner,fill=False)
show(p1+p2,axes=False)


Draw trigonometric functions

Background=circle((0,0),1,thickness=3)+plot(sin(x),-4*pi,4*pi,ymin=-1.1,ymax=1.1,ticks=pi/2,tick_formatter=pi,figsize=20,thickness=3)
v1=[points((2*pi*t/90,sin(2*pi*t/90)),color='red',size=100)+points((cos(2*pi*t/90),sin(2*pi*t/90)),color='red',size=100)+line([(0,0),(cos(2*pi*t/90),sin(2*pi*t/90))],thickness=3,color='black')+Background for t in range(180)]
v3=[points((-2*pi*t/90,sin(-2*pi*t/90)),color='red',size=100)+points ((cos(-2*pi*t/90),sin(-2*pi*t/90)),color='red',size=100)+line([(0,0),(cos(-2*pi*t/90),sin(-2*pi*t/90))],thickness=3,color='black')+Background for t in range(180)]
v2=v1[::-1]
v4=v3[::-1]
v1.extend(v2)
v1.extend(v3)
v1.extend(v4)
a=animate(v1)

a.show(delay=5)