# # The program that animates two flying objects # input: n --- the upper bound of the arrays # x,y --- arrays 0..n, positions of object one # u,v --- arrays 0..n, positions of object two # Output: Maple animation # Animate2d2c:=proc( x :: Vector, y :: Vector, u :: Vector, v :: Vector ) local n, i, j, p, q, r, xmax, xmin, ymax, ymin; n := LinearAlgebra[Dimension](x); xmax:=max( seq(x[i],i=1..n),seq(u[i],i=1..n) ); xmin:=min( seq(x[i],i=1..n),seq(u[i],i=1..n) ); ymax:=max( seq(y[i],i=1..n),seq(v[i],i=1..n) ); ymin:=min( seq(y[i],i=1..n),seq(v[i],i=1..n) ); p:=array(1..n); q:=array(1..n); r:=array(1..n); for i to n do p[i]:=[ seq( [x[j],y[j]], j=1..i ) ]; q[i]:=[ seq( [u[j],v[j]], j=1..i ) ]; r[i]:=plot([p[i],q[i]],xmin..xmax, ymin..ymax, axes=frame); od; plots[display]( [seq(r[i],i=1..n)], insequence=true, style=line); end;