Advertisement
Matthen

Venus and Earth

Feb 27th, 2015
4,921
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. r = 0.72;
  2. \[Phi] = N[13/8];
  3. earth[t_] := {Sin[2 Pi t], Cos[2 Pi t]};
  4. venus[t_] := r {Sin[\[Phi] 2 Pi t], Cos[\[Phi] 2 Pi t]};
  5. stars = RandomReal[1.5 {-1, 1}, {10, 2}];
  6. frame[tmax_] := (
  7. Graphics[{
  8. {White, Point[stars]},
  9. {White, Opacity[0.8],
  10. Table[
  11. Line[{earth[t], venus[t]}],
  12. {t, 0, Min[tmax, 8], 0.01}]
  13. },
  14. Opacity[If[tmax > 8, 9 - tmax, 1]],
  15. If[tmax < 8, EdgeForm[Black], {}],
  16. {White, Thickness[0.007], Circle[{0, 0}, 1], Circle[{0, 0}, r]},
  17. {Lighter@Blue, Disk[earth[tmax], 0.05]},
  18. {Lighter@Lighter@Orange, Disk[venus[tmax], 0.04]},
  19. {EdgeForm[], Yellow, Disk[{0, 0}, 0.1]}
  20. }, Background -> Black, PlotRange -> 1.5, ImageSize -> 500]
  21. );
  22. Manipulate[frame[t], {t, 0, 9}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement