Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comet[eccentricity_]:=Module[{e = eccentricity},
- velocity = NDSolve[{v'[t]*Power[1+e, 2]/Power[1+Cos[v[t]]*e, 2] == 1, v[0]==0},
- v, {1, -1000, 1000}][[1, 1, 2]];
- y[tt_, ec_]:=(1+ec)*Cos[velocity[tt]]/(1+ec*Cos[velocity[tt]]);
- y[tt_, ec_]:=(1+ec)*Sin[velocity[tt]]/(1+ec*Cos[velocity[tt]]);
- Animate[Graphics[{{Yellow, Disk[{0,0}, 0.4]}, PointSize[0.005],
- Point@Table[{x[tt, e],y[tt,e]},{tt, -t, t, 1}]}, Axes->True,
- PlotRange->{{-20, 1.5},{-10,10}}, ImageSize->{500, 350}], {t, 1, 100}]]
- comet[0.5]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement