Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168741
Image: ubuntu2004
__main__:1: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) __main__:53: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) __main__:54: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) __main__:57: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) __main__:58: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) __main__:59: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) __main__:60: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...)
# # interact section # slider for parameter, 24 settings # checkboxes for various vector displays # computations at one value of parameter, t0 # @interact def _( pos_check = ("Position", True), vel_check = ("Velocity", False), tan_check = ("Unit Tangent", False), nor_check = ("Unit Normal", False), bin_check = ("Unit Binormal", False), acc_check = ("Acceleration", False), tancomp_check = ("Tangential Component", False), norcomp_check = ("Normal Component", False), circle_check = ("Osculating Circle", False), t0 = slider(float(start), float(stop), float((stop-start)/24), float(start) , label = "Parameter"), ): # # location of interest # pos_tzero = position(t0) # # various scalar quantities at point # speed_component = speed(t0) tangent_component = speed_deriv(t0) normal_component = math.sqrt( acceleration(t0).norm()^2 - tangent_component^2 ) curvature = normal_component/speed_component^2 ## torsion = (1/speed_component)*(dB(t0)).dot_product(normal(t0)) # # accumulate the graphic based on checkboxes # picture = path if pos_check: picture += arrow3d((0,0,0), pos_tzero, rgbcolor=(0,0,0)) if vel_check: picture += arrow3d(pos_tzero, pos_tzero + velocity(t0), rgbcolor=(0,0.5,0)) if tan_check: picture += arrow3d(pos_tzero, pos_tzero + tangent(t0), rgbcolor=(0,1,0) ) if nor_check: picture += arrow3d(pos_tzero, pos_tzero + normal(t0), rgbcolor=(0.5,0,0)) if bin_check: picture += arrow3d(pos_tzero, pos_tzero + binormal(t0), rgbcolor=(0,0,0.5)) if acc_check: picture += arrow3d(pos_tzero, pos_tzero + acceleration(t0), rgbcolor=(1,0,1)) if tancomp_check: picture += arrow3d(pos_tzero, pos_tzero + tangent_component*tangent(t0), rgbcolor=(1,0,1) ) if norcomp_check: picture += arrow3d(pos_tzero, pos_tzero + normal_component*normal(t0), rgbcolor=(1,0,1)) if circle_check: radius = 1.0/curvature m = identity_matrix(RDF,4) m[0:3,0] = -normal(t0) m[0:3,1] = tangent(t0) m[0:3,2] = binormal(t0) #m=matrix(zip(-normal(t0), tangent(t0), binormal(t0), pos_tzero+radius*normal(t0))).stack(matrix([0,0,0,1])) tx = sage.plot.plot3d.transform.Transformation(m=m) c = circle(center=(0,0), radius=radius, rgbcolor=(0.5,0,0)).plot3d() picture += c.transform(T=tx).translate(pos_tzero+radius*normal(t0)) # # print textual info # print "Position vector: r(t)=", position(t) print "Speed is ", N(speed_component) print "Curvature is ", N(curvature) ## print "Torsion is ", N(torsion) # # show accumulated graphical info # show(picture, xmin=-3,xmax=3,ymin=-2,ymax=2,aspect_ratio=[1,1,1])