Matthen

Valentines card-ioid

Feb 14th, 2013
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. point[p0_, t_] :=
  2. RotationMatrix[-4 Pi t, {0, 0, 1}].p0 +
  3. RotationMatrix[-2 Pi t, {0, 0, 1}].{0, 2, 0};
  4. d\[Theta] = Pi/3;
  5. p0s = Table[u = RandomReal[{0, 2 Pi}];
  6. v = RandomReal[{0, Pi}]; {Sin[u] Cos[v], Sin[u] Sin[v],
  7. Cos[u]}, {i, 20}];
  8. AppendTo[p0s, {0, -1, 0}];
  9. p0fns = Table[point[p0, \[Tau]], {p0, p0s}];
  10. frame[t_] :=
  11. Show[
  12. Graphics3D[
  13. {
  14. Opacity[0.9],
  15. Sphere[{0, 0, 0}, 1],
  16. Sphere[2 {Sin[2 Pi t ], Cos[2 Pi t ], 0}, 1],
  17. Point[Table[p0fn /. {\[Tau] -> t}, {p0fn, p0fns[[;; -2]]}]],
  18. PointSize[Medium], Red, Point[p0fns[[-1]] /. {\[Tau] -> t}]
  19. }
  20. , PlotRange -> 3, Boxed -> False],
  21. ParametricPlot3D[Table[
  22. p0fn,
  23. {p0fn, p0fns[[;; -2]]}
  24. ], {\[Tau], Max[0, t - 1], Min[t, 1]},
  25. PlotStyle -> Directive[Thin, Blue, Opacity[0.7]]],
  26. ParametricPlot3D[
  27. p0fns[[-1]], {\[Tau], Max[0, t - 1], Min[t, 1]},
  28. PlotStyle -> Directive[Thick, Red]]
  29. , ViewPoint -> {-5, -5, 10}, ImageSize -> 300];
  30. Manipulate[frame[t], {t, 0.001, 1.999, 2/80.1}]
Advertisement
Add Comment
Please, Sign In to add comment