Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168759
Image: ubuntu2004

Osculating circle to a helix.

# Define the helix in parametric form t=var('t');r=vector([cos(t),sin(t),t]); # Compute T and N vectors rp=diff(r,t); T=rp/rp.norm(); Tp=diff(T,t); N=Tp/Tp.norm(); # Radius is reciprocal of curvature rpp=diff(rp,t); v=vector(rp(t=pi/4)); radius=1/((v.cross_product(rpp(t=pi/4))).norm()/(norm(rp(t=pi/4)))^3) # The circle in terms of T and N u=var('u');c=r(t=pi/4)+radius*N(t=pi/4)+cos(u)*radius*N(t=pi/4)+sin(u)*radius*T(t=pi/4); # Plot the circle, plot the helix, show with axes cplot=parametric_plot3d(c,(u,0,2*pi),frame=False,aspect_ratio=[1,1,1]) hplot=parametric_plot3d((cos(t),sin(t),t),(t,-pi/4,pi),rgbcolor=(1,0,0)) from sage.plot.plot3d.shapes2 import ruler show(cplot+hplot+ruler([0,0,-1],[0,0,3],sub_ticks=0,absolute=True,color="black")+ruler([0,-2,0],[0,2,0],absolute=true,sub_ticks=0,color="black")+ruler([-2,0,0],[2,0,0],absolute=true,sub_ticks=0,color="black"),figsize=[8,8])