jsMath
Edit this. Download. Other published documents...

The nephroid of Freeth

10 seconds ago by admin

##Note: this was created in Sage 4.1.1.  The code in this sheet breaks in newer versions of Sage.
a = 1.0
t = var('t')
F = parametric_plot([(1+2*sin(t/2))*cos(t), (1+2*sin(t/2))*sin(t)],[t,0,4*pi], rgbcolor = (1,0,1))

show(F,aspect_ratio=1) 
       
a = 1.0
t = var('t')
xtreme=3
myaxes = line([[-xtreme,0],[xtreme,0]],rgbcolor = (0,0,0))
myaxes = myaxes + line([[0,-xtreme],[0,xtreme]],rgbcolor = (0,0,0))
def nephroid(theta):
   C = circle((0,0),a,rgbcolor = (0,0,0))
   A=[a,0]
   O=[0,0]
   M=[a*cos(theta),a*sin(theta)]
   l=a*sqrt(2*(1-cos(theta)))
   P1=[a*cos(theta)-l*a*cos(theta),a*sin(theta)-l*a*sin(theta)]
   P2=[a*cos(theta)+l*a*cos(theta),a*sin(theta)+l*a*sin(theta)]
   L1 = line([P1,P2])
   L2 = line([A,M])
   M=point(M)
   A=point(A)
   P1=point(P1)
   P2=point(P2)
   O=point(O)
   return C+O+A+M+P1+P2+L1+L2+myaxes


def Freeth(theta):
   ne = nephroid(theta)
   Freethplot = parametric_plot([(1+2*sin(t/2))*cos(t), (1+2*sin(t/2))*sin(t)],[t,0,theta], rgbcolor = (1,0,1))
   return ne+Freethplot

a2 = animate([Freeth(i) for i in srange(float(0),float(4*pi),float(pi)/30)],aspect_ratio=1)

a2.show()