Question: Animate a Line.

I am asking this beacuse I am rusty on using animate in plots. Just trying to show the line segment moving.

restart

with(plottools); with(plots)

Trvl := Matrix(5, 18, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 2, (1, 4) = 3, (1, 5) = 4, (1, 6) = 5, (1, 7) = 6, (1, 8) = 7, (1, 9) = 8, (1, 10) = 9, (1, 11) = 10, (1, 12) = 11, (1, 13) = 12, (1, 14) = 13, (1, 15) = 14, (1, 16) = 15, (1, 17) = 16, (1, 18) = 17, (2, 1) = 25.00000000, (2, 2) = 25.62348980, (2, 3) = 26.24697960, (2, 4) = 26.87046941, (2, 5) = 27.49395921, (2, 6) = 28.11744901, (2, 7) = 28.81795052, (2, 8) = 29.70796779, (2, 9) = 30.69482490, (2, 10) = 31.66997559, (2, 11) = 32.64189447, (2, 12) = 33.63901734, (2, 13) = 34.59934793, (2, 14) = 35.46317753, (2, 15) = 36.17679740, (2, 16) = 36.69583812, (2, 17) = 36.98802824, (2, 18) = 37.03520080, (3, 1) = 9.50000000, (3, 2) = 10.28183148, (3, 3) = 11.06366296, (3, 4) = 11.84549445, (3, 5) = 12.62732593, (3, 6) = 13.40915741, (3, 7) = 14.11748988, (3, 8) = 14.56318511, (3, 9) = 14.69313898, (3, 10) = 14.49329251, (3, 11) = 14.26929209, (3, 12) = 14.29271187, (3, 13) = 14.56209574, (3, 14) = 15.06069470, (3, 15) = 15.75750830, (3, 16) = 16.60921202, (3, 17) = 17.56285107, (3, 18) = 18.55913279, (4, 1) = 26.55872458, (4, 2) = 27.18221431, (4, 3) = 27.80570411, (4, 4) = 28.44091912, (4, 5) = 29.26771501, (4, 6) = 30.27132826, (4, 7) = 31.26754127, (4, 8) = 32.19797655, (4, 9) = 33.15526524, (4, 10) = 34.16855668, (4, 11) = 35.08363639, (4, 12) = 35.87210441, (4, 13) = 36.48493760, (4, 14) = 36.88403298, (4, 15) = 37.04457671, (4, 16) = 36.95658698, (4, 17) = 36.62553455, (4, 18) = 36.06730316, (5, 1) = 11.45457880, (5, 2) = 12.23641019, (5, 3) = 13.01824167, (5, 4) = 13.79066482, (5, 5) = 14.38908368, (5, 6) = 14.67833203, (5, 7) = 14.61699479, (5, 8) = 14.33989949, (5, 9) = 14.25015666, (5, 10) = 14.40907532, (5, 11) = 14.80585186, (5, 12) = 15.41668792, (5, 13) = 16.20360467, (5, 14) = 17.11767545, (5, 15) = 18.10206776, (5, 16) = 19.09557685, (5, 17) = 20.03643114, (5, 18) = 20.86416514})

_rtable[36893489645234278260]

(1)

display(seq(line([Trvl[2, i], Trvl[3, i]], [Trvl[4, i], Trvl[5, i]], color = green), i = 1 .. 18))

 

animate(line([Trvl[2, i], Trvl[3, i]], [Trvl[4, i], Trvl[5, i]], color = green), i = 1 .. 18)

Error, bad index into Matrix

 

NULL

Download 23-11-03_Q_Animate_a_line.mw

Please Wait...