# This is not a hypotrochoid.
reset()
var('t')
R=5;r=3;d=5;a=0;
@interact
def _(b=slider(0,12*pi,pi/12,0)):
p=(R-r)*vector([sin((r/R)*t),cos((r/R)*t)])
f=p+d*vector([-sin(t),cos(t)])
html('$d = %s {<} r = %s {<} R = %s$' %(d,r,R))
P = parametric_plot(f,(t,0,b+.0001))
P+=circle((0,0),R,color="red")
P+=circle(p(t=b),r)+point(p(t=b),size=20)
P+=point(f(t=b),size=20,color="red")
P+=line((p(t=b),f(t=b)),color="green",thickness=2)
P+=line((p(t=b),p(t=b)+r/2*(p(t=b))),color="red",thickness=1,linestyle=":")
show(P)
Click to the left again to hide and once more to show the dynamic interactive window
# This is not a hypotrochoid.
reset()
var('t,l')
R=5;r=2;d=3;a=0;
@interact
def _(b=slider(0,4*pi,pi/24,0)):
p=(R-r)*vector([sin((r/R)*t),cos((r/R)*t)])
f=p+d*vector([-sin(t),cos(t)])
M=matrix([[cos(t),-sin(t)],
[sin(t),cos(t)]])
html('$d = %s {<} r = %s {<} R = %s$' %(d,r,R))
P=parametric_plot(f,(t,0,b+.0001))
P+=circle((0,0),R,color="red")
P+=circle(p(t=b),r)
P+=point(p(t=b),size=20)
P+=point(f(t=b),size=20,color="red")
P+=arrow2d(p(t=b),f(t=b),color="green")
P+=arrow2d((0,0),p(t=b),color="red")
P+=arrow2d(path=[[(p(t=b)+.2*M(t=u)*vector([0,1])) for u in [0..b,step=pi/24]]],
width=1,arrowsize=2,color=(.5,.5,.5),zorder=1)
P+=line((p(t=b),p(t=b)+r/2*vector([0,1])),color="red",thickness=1,linestyle=":")
P+=text("${\\theta}$",
p(t=b)+.2*M(t=b/2)*p(t=b),vertical_alignment="bottom",fontsize=14)
P+=text('$P(\\theta)$',f(t=b),
horizontal_alignment='left',vertical_alignment='bottom',
fontsize=14)
show(P,xmin=-1.5,xmax=4.5,ymin=-.5,ymax=6.3)
Click to the left again to hide and once more to show the dynamic interactive window
# This is a hypotrochoid which is different from the above
reset()
var('t')
R=5;r=2.6;d=5;a=0;
@interact
#def _(b=slider(0,12*pi,pi/12,0)):
def _(b=[0..12*pi,step=pi/6]):
p=(R-r)*vector([sin((r/R)*t),cos((r/R)*t)])
f=p+d*vector([-sin((R-r)/R*t),cos((R-r)/R*t)])
html('$d = %s {<} r = %s {<} R = %s$' %(d,r,R))
P = parametric_plot(f,(t,0,b+.0001))
P+=circle((0,0),R,color="red")
P+=circle(p(t=b),r)+point(p(t=b),size=20)
P+=point(f(t=b),size=20,color="red")
P+=line((p(t=b),f(t=b)),color="green",thickness=2)
P+=line((p(t=b),p(t=b)+r/2*(p(t=b))),color="red",thickness=1,linestyle=":")
show(P)
b
Click to the left again to hide and once more to show the dynamic interactive window
reset()
var('t,l')
R=5;r=2;d=3;a=0;
#_(b=slider(0,4*pi,pi/24,0)):
@interact
def _(b=[0..4*pi,step=pi/6]):
p=(R-r)*vector([sin((r/R)*t),cos((r/R)*t)])
f=p+d*vector([-sin((R-r)/R*t),cos((R-r)/R*t)])
M=matrix([[cos(t),-sin(t)],
[sin(t),cos(t)]])
html('$d = %s {<} r = %s {<} R = %s$' %(d,r,R))
P=parametric_plot(f,(t,0,b+.0001))
P+=circle((0,0),R,color="red")
P+=circle(p(t=b),r)
P+=point(p(t=b),size=20)
P+=point(f(t=b),size=20,color="red")
P+=arrow2d(p(t=b),f(t=b),color="green")
P+=arrow2d((0,0),p(t=b),color="red")
if (b>0):
P+=arrow2d(path=[[(p(t=b)+.2*M(t=u)*p(t=b)) for u in [0..b,step=pi/24]]],
width=1,arrowsize=2,color=(.5,.5,.5),zorder=1)
P+=line((p(t=b),p(t=b)+r/2*p(t=b)),color="red",thickness=1,linestyle=":")
P+=text("${\\theta}$",
p(t=b)+.2*M(t=b/2)*p(t=b),vertical_alignment="bottom",fontsize=14)
P+=text("${\\alpha}$",
p(t=b)+.13*M(t=r/R*b/3)*p(t=b),vertical_alignment="bottom",fontsize=14)
P+=text("${\\alpha}$",
vector([0,0])+.13*M(t=r/R*b/3)*p(t=b),vertical_alignment="bottom",fontsize=14)
P+=text('$P(\\theta)$',f(t=b),
horizontal_alignment='left',vertical_alignment='bottom',
fontsize=14)
P+=line((p(t=b),p(t=b)+r/2*vector([0,1])),color="red",linestyle=":")
show(P,xmin=-1.5,xmax=4.5,ymin=-.5,ymax=6.3)
b
Click to the left again to hide and once more to show the dynamic interactive window