Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: parametric
Views: 27
%auto typeset_mode(True, display=False) curve(t,a,vx,vy,r,w) = [vx*t-r*cos(w*t), r*sin(w*t)-a*t^2/2 + vy*t] @interact def parametric(F = input_box(default=10, label='$\\frac{w}{2\pi}$: '), \ R = input_box(default=0.1, label='$r$: '), \ V = input_box(default=9, label='$||v||$: '), \ THETA = input_box(default=70, label='$\\theta \; [{}^\circ]$: '), \ axis = selector(["x","t"], label='axis', nrows=1, ncols=2, buttons=True)): W = 2*pi*F A = 10 Vx = V*cos(THETA*pi/180) Vy = V*sin(THETA*pi/180) c = curve(a=A,vx=Vx,vy=Vy,r=R,w=W) T = c[1].find_root(V/A,2*V/A) vx = var ('v_x', latex_name="v_{x}") vy = var ('v_y', latex_name="v_{y}") pretty_print(curve.subs(vx=vx,vy=vy)) pretty_print(LatexExpr('$t \; \in \; (0,{})$'.format(T))) if axis == 'x': p = [parametric_plot (c, (t,0,T)), parametric_plot(curve(a=A,vx=Vx,vy=Vy,r=0,w=0),(t,0,T),linestyle='--',color='red')] elif axis == 't': p = [plot (c[1], (t,0,T)), plot(curve(a=A,vx=Vx,vy=Vy,r=0,w=0)[1],(t,0,T),linestyle='--',color='red')] show(sum(p))
Interact: please open in CoCalc