Skip to content

Instantly share code, notes, and snippets.

@joshuagruenstein
Created April 25, 2017 04:41
Show Gist options
  • Save joshuagruenstein/82761de298a148da908bbad4c2c0a90d to your computer and use it in GitHub Desktop.
Save joshuagruenstein/82761de298a148da908bbad4c2c0a90d to your computer and use it in GitHub Desktop.
Kinematics plotting for Siney
Export["siney.gif",
Table[
Show[Graphics[
Translate[
Rotate[{Circle[], Thick, Blue, Line[{{0, 0}, {0, -1}}], Red,
PointSize[.02], Point[{0, -1}]}, t], { 2 Pi, 0}],
PlotRange -> {{0, 4 Pi}, {-2, 2}}, ImageSize -> {Large, Tiny},
Axes -> {True, False}, AxesOrigin -> {0, -1}],
Graphics[
Plot[Sin[x + t - Sin[t] + 3*Pi/2], {x, -4 Pi, 4 Pi}]
]
], {t, 0, 4*Pi - 0.25, 0.25}]
, ImageSize -> 1200]
Export["cycloid.gif" ,
Table[Show[
Graphics[
Translate[
Rotate[{Circle[], Thick, Blue, Line[{{0, 0}, {0, -1}}], Red,
PointSize[.02], Point[{0, -1}]}, t], { 2 Pi, 0}],
PlotRange -> {{0, 4 Pi}, {-2, 2}}, ImageSize -> {Large, Tiny},
Axes -> {True, False}, AxesOrigin -> {0, -1}],
Graphics[
ParametricPlot[{-t + x + Cos[x] + Pi/2, Sin[x]}, {x, -4 Pi,
8 Pi}]
]
], {t, 0, 2*Pi - 0.25, 0.25}]
, ImageSize -> 1200]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment