Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168726
Image: ubuntu2004
var('x,y,z,t,r') r=vector([sin(t),cos(t),2*t]) print"Problem 1: " print"1. + 2. = graph" def tangentVector(r,t): return(diff(r,t)/norm(diff(r,t))) def normalVector(r,t): return(diff(tangentVector(r,t),t)/(norm(diff(tangentVector(r,t),t)))) def binormalVector(r,t): return(tangentVector(r,t).cross_product(normalVector(r,t))) def Plottangent(r,t,to,**kwarg): var('u,to') r0=r(t=to) Ta=tangentVector(r,t)(t=to) return parametric_plot3d(list(r0+Ta*u),(u,0,1),**kwarg) def Plotnormal(r,t,to,**kwarg): var('u,to') r0=r(t=to) No=normalVector(r,t)(t=to) return parametric_plot3d(list(r0+No*u),(u,0,1),**kwarg) def Plotbinormal(r,t,to,**kwarg): var('u,to') r0=r(t=to) Bi=binormalVector(r,t)(t=to) return parametric_plot3d(list(r0+Bi*u),(u,0,1),**kwarg) A = parametric_plot3d(r(t),(t,-10,10), thickness = 5) B = Plottangent(r(t),t,-2,thickness=5,color='red') C = Plotnormal(r(t),t,-2,thickness=5,color='green') D = Plotbinormal(r(t),t,-2,thickness=5,color='orange') E = implicit_plot3d(x==-19.99,(x,-20,20),(y,-20,20),(z,-20,20),color='white') F = numerical_approx(integral(norm(diff(r,t)),t,0,-2)) print"3. length of the curve from t=0 to t=-2: ",F r1 = diff(r,t) r2 = diff(r1,t) curvature = (norm(r1.cross_product(r2))/((norm(r1))^3)) print"4. curvature at t=-2: ",numerical_approx(curvature(t=2)) A+B+C+D+E
Problem 1: 1. + 2. = graph 3. length of the curve from t=0 to t=-2: -4.47213595499958 4. curvature at t=-2: 0.200000000000000
asdf = vector([(e^(t))*sin(t),t,(e^(t))*cos(t)]) G = parametric_plot3d(asdf,(t,-10,10),thickness=5) print"5. + 6. = graph" H = Plottangent(asdf,t,-2,thickness=5,color='red') I = Plotnormal(asdf,t,-2,thickness=5,color='green') J = Plotbinormal(asdf,t,-2,thickness=5,color='orange') K = implicit_plot3d(x==-19999.99,(x,-20000,20000),(y,-20000,20000),(z,-20000,20000),color='white') L = numerical_approx(integral(norm(diff(asdf,t)),t,0,-2)) print"7. length of the curve from t=0 to t=-2: ",L asdf1=diff(asdf,t) asdf2=diff(asdf1,t) M = (norm(asdf1.cross_product(asdf2))/((norm(asdf1))^3)) print"8. curvature at t=-2: ",numerical_approx(M(t=-2)) G+H+I+J+K
5. + 6. = graph 7. length of the curve from t=0 to t=-2: -2.41102905936836 8. curvature at t=-2: 0.258788978266708