楕円
の速度ベクトル、加速度ベクトルのアニメーションを作る。
可視化に必要な関数を下記で定義する。
sage: t = var('t') sage: x = 9*cos(t) sage: y = 4*sin(t) sage: vx,vy = x.derivative(),y.derivative() sage: ax,ay = vx.derivative(),vy.derivative()
楕円そのものは parametric_plot を使う。
sage: parametric_plot((x,y),(0,2*pi)) Launched png viewer for Graphics object consisting of 1 graphics primitive
媒介変数 を から まで 0.2 ずつ変化させる。
sage: l = [parametric_plot((x,y),(0,2*pi),xmin=-14,xmax=14,ymin=-7,ymax=7)+arrow2d((x(s),y(s)),(x(s)+vx(s),y(s)+vy(s)),xm ....: in=-14,xmax=14,ymin=-7,ymax=7,rgbcolor="red")+arrow2d((x(s),y(s)),(x(s)+ax(s),y(s)+ay(s)),xmin=-14,xmax=14,ymin=-7, ....: ymax=7,rgbcolor="green")+point2d((x(s),y(s)),size=90,xmin=-14,xmax=14,ymin=-7,ymax=7,rgbcolor="gray") for s in sxra ....: nge(0,2*pi,0.2)] /opt/sagemath-9.2/src/bin/sage-ipython: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=...) See http://trac.sagemath.org/5930 for details. #!/usr/bin/env sage-python sage: animate(l) Launched gif viewer for Animation with 32 frames
加速度ベクトルがつねに原点を指しています。