Juhuslik tasapinnaline liikumine

<< Graphics`

Juhuslike vektorite genereerimine

a = Table[{Random[], (Random[] - 0.5)}, {i, 100}];

Järgmiste punktide koordinaatide arvutamine

b = 
        Table[Sum[a[[k]], {k, 1, i}], {i, 1, Length[a]}];

Trajektoori animatsioon

b1 = Last[Transpose[b]];

alumine = Min[b1] - 1;

ylemine = Max[b1] + 1;

ekslemine = 
      Table[ListPlot[Take[b, i], PlotJoined -> True, 
          PlotRange -> {{0, Max[b] + 1}, {alumine, ylemine}}], {i, 1, 
          100}]

Export["ekslemine.gif", ekslemine, "GIF", 
      ConversionOptions -> {"Loop" -> True}]

Punase õhupalli veeremine hallil asfaldil

\(\(ekslemine2 = 
        Table[Show[\ 
            Graphics[\ 
	{Hue[0], Circle[b[\([i]\)], 1.5]}\ , 
              PlotRange -> {{\(-1.5\), Max[b] + 1.5}, {alumine - 1.5, 
                    ylemine + 1.5}}, AspectRatio -> Automatic, 
              Background -> GrayLevel[0.6]]], \ 
	{i, 1, 
            100}];\)\)

Export["ekslemine3.gif", ekslemine2, "GIF", 
      ConversionOptions -> {"Loop" -> True}]