(%i1) |
with_slider_draw( k,makelist(i,i,1,7), proportional_axes = xy, xrange = [-3,3], yrange = [-3,3], xaxis=true, yaxis=true, grid = true, title = "Circle and Line" , label([sconcat("k=",(k-4)*sqrt(5)),-1,2]), implicit(x^2+y^2=1,x,-3,3,y,-3,3), explicit(2*x+(k-4)*sqrt(5),x,-3,3) ); |
(%i1) | load(draw)$ |
(%i2) |
cyc(r):=block( if r>0 then q:3+abs(r) else q:1, with_slider_draw( k,makelist(i,i,0,10), proportional_axes = xy, xrange = [-q,q], yrange = [-q,q], xaxis=true, yaxis=true, grid = true, title = "epi-hypo-cycloid", label([sconcat("Ratio of radius 1:",r),-1,q-q/10]), implicit((x-(r+1)*cos(2*%pi*k/10))^2+(y-(r+1)*sin(2*%pi*k/10))^2=r^2 ,x,-q,q,y,-q,q), implicit(x^2+y^2=1,x,-q,q,y,-q,q), color = red, parametric((r+1)*cos(t)-r*cos(t*(1+r)/r),(r+1)*sin(t)-r*sin(t*(1+r)/r) ,t,0,2*%pi*k/10) ) )$ |
--> |
with_slider_draw3d( k,makelist(k,k,1,10), dimensions=[500,500], xrange=[-2,2], yrange=[-2,2], parametric( (cos(k*2*%pi/10+%pi/2)-cos(k*2*%pi/10))*s+cos(k*2*%pi/10), (sin(k*2*%pi/10+%pi/2)-sin(k*2*%pi/10))*s+sin(k*2*%pi/10), -2*s+1,s,0,1) )$ |
--> | load(draw)$ |
--> |
apply(draw, append([terminal=animated_gif, delay=50,file_name="d:/fs/line-rot.gif"], makelist( gr3d( xrange=[-2,2], yrange=[-2,2], parametric( (cos(k*2*%pi/10+%pi/2)-cos(k*2*%pi/10))*s+cos(k*2*%pi/10), (sin(k*2*%pi/10+%pi/2)-sin(k*2*%pi/10))*s+sin(k*2*%pi/10), -2*s+1,s,0,1) ), k,1,10)))$ |