SHARE
TWEET

Geodesics in Rotating Frame

Matthen May 14th, 2013 228 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = 6;
  2. \[Omega] = 1/2;
  3. p1s = Table[{-Sqrt[1 - y^2], y}, {y, -1, 1, 2/n}][[2 ;; -2]];
  4. p1s2 = Table[{x, -Sqrt[1 - x^2]}, {x, -1, 1, 2/n}][[2 ;; -2]];
  5. Manipulate[
  6.  Show[
  7.   Graphics[{
  8.     Circle[{0, 0}, 1],
  9.     Table[
  10.      Line[{{Sin[\[Theta] + \[Omega] t],
  11.         Cos[\[Theta] + \[Omega] t]}, {Sin[\[Theta] + \[Omega] t + Pi],
  12.          Cos[\[Theta] + \[Omega] t + Pi]}}],
  13.      {\[Theta], 0, Pi, Pi/5}],
  14.     Table[
  15.      Block[{
  16.        pt =
  17.         p1 Max[0, (1 - (t/(2 Pi))/(-p1[[1]]))] + {-p1[[1]],
  18.            p1[[2]]} Min[1, (t/(2 Pi))/(-p1[[1]])]
  19.        },
  20.       {Disk[pt, 0.05],
  21.        Opacity[0.5], Darker[Red], Line[{p1, pt}]
  22.        }]
  23.      , {p1, p1s}],
  24.     Table[
  25.      Block[{
  26.        pt =
  27.         p1 Max[0, (1 - (t/(2 Pi))/(-p1[[2]]))] + {p1[[
  28.             1]], -p1[[2]]} Min[1, (t/(2 Pi))/(-p1[[2]])]
  29.        },
  30.       {Disk[pt, 0.05],
  31.        Opacity[0.5], Darker[Red], Line[{p1, pt}]
  32.        }]
  33.      , {p1, p1s2}]
  34.     }, PlotRange -> 1.1],
  35.   Table[
  36.    ParametricPlot[
  37.     RotationMatrix[\[Omega] (\[Tau] - t)].(
  38.       p1 Max[0, (1 - (\[Tau]/(2 Pi))/(-p1[[1]]))] + {-p1[[1]],
  39.          p1[[2]]} Min[1, (\[Tau]/(2 Pi))/(-p1[[1]])]
  40.       )
  41.     , {\[Tau], -0.001, t}, PlotStyle -> Thick]
  42.    , {p1, p1s}
  43.    ],
  44.   Table[
  45.    ParametricPlot[
  46.     RotationMatrix[\[Omega] (\[Tau] - t)].(
  47.       p1 Max[
  48.          0, (1 - (\[Tau]/(2 Pi))/(-p1[[2]]))] + {p1[[
  49.           1]], -p1[[2]]} Min[1, (\[Tau]/(2 Pi))/(-p1[[2]])]
  50.       )
  51.     , {\[Tau], -0.001, t}, PlotStyle -> Thick]
  52.    , {p1, p1s2}
  53.    ]
  54.   ],
  55.  {t, 0, 2 Pi}
  56.  ]
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top