Related to Joseph O'Rourke's cycloid idea, I've used the following to discuss the motion of a train wheel, part of which is always moving backwards when the train is moving forwards (which now has an explanation on MSE. The length of the code is due to the ornamentation of the demonstration. The color-coded horizontal components of the velocity (which are constant at a given level above or below the rail) are plotted in the background; they are also plotted below for some of the actual positions of the point on the wheel. There are some spokes and points on the wheel to help visualize the rolling motion when the t
slider is moved. The distance R
of the traced point from the center is adjustable, too.
Manipulate[
With[{
cyc0 = (* full cycloid path, computed once for all t *)
Table[{θ}~Join~cycloid[R, θ], {θ, 0, 3 π, π/18}],
bg = { (* background: vertical grid, horizontal arrows *)
{Thin, LightGray,
Line[
Table[{{t0, -2.2}, {t0, 2.2}}, {t0, π/3, 3 π, π/3}]],
Gray,
Line[{{{0, -2.2}, {0, 2.2}}, {{2 π, -2.2}, {2 π, 2.2}},
{{-2.1, 0}, {3 π + 2.1, 0}}}]},
{Arrowheads[Small],
Table[{Hue[(y + 1)/5, 0.7, 1],
Arrow[
Partition[
Table[{t0, y}, {t0,
If[y > -1, 0 - 5 π, 3 π + π],
If[y < -1, 0 - 5 π, 3 π + π], (y + 1) π/6}],
2, 1]]
}, {y, {-2, -15/10, -5/10, 0, 5/10, 1, 15/10, 2}}]},
Thickness[Medium], Line[{{{-2.1, -1}, {3 π + 2.1, -1}}}]}},
Dynamic@Show[
With[{ (* cycloid path 0 ≤ θ ≤ t *)
cyc =
Append[Cases[cyc0, x_?(#[[1]] <= t &) :> Rest[x]], cycloid[R, t]]},
Graphics[{
bg,
Line[{{{-2.1, -1}, {3 π + 2.1, -1}}}], (* rail *)
With[{L = Max[R, 1], l = Min[R, 1]}, (* spokes *)
{Lighter@Gray,
Line[Table[{circle[{t, 0}, L, θ + t],
circle[{t, 0}, -L, θ + t]}, {θ, 0, 2 π/3, π/3}]]}],
{ (* rest of wheel *)
Thick, Circle[{t, 0}],
Thickness[Medium], Circle[{ t, 0}, R], PointSize[Medium],
Point[Table[
circle[{t, 0}, 1, θ + t], {θ, 0, 5 π/3, π/3}]],
Line[{{ t, 0}, cycloid[R, t]}],
Disk[{t, 0}, 1, {-t + π, -t + 5 π/6}],
Disk[{t, 0}, 1, {-t, -t - π/6}]},
{ (* Velocity vector plots below plot *)
Arrowheads[Small],
Table[{Hue[(R Sin[-π/2 - t0] + 1)/5, 0.7, 1],
Arrow[With[{y0 =
If[#[[1, 1]] > #[[2, 1]], -2.4,
If[t0 > 2 π, -2.8, -2.6]]},
{{#[[1, 1]], y0}, {#[[2, 1]], y0}}]
] &[{cycloid[R, t0 - π/12], cycloid[R, t0 + π/12]}]
}, {t0, 0, t, π/6}]},
{ (* cycloid *)
{Thickness[0.008], Gray, Line[cyc]}, (* frames the cycloid *)
{ (* leading point of the trace of the cycloid *)
Hue[(R Sin[-π/2 - t] + 1)/5, 1, 1], EdgeForm[Black],
Disk[cycloid[R, t], 0.075]},
Thick, (* the cycloid & mesh points *)
Line[cyc, VertexColors -> (Hue[(#[[2]] + 1)/5] & /@ cyc)],
Black, Point[cycloid[R, #] & /@ Range[0, t, π/6]], Gray,
Point[cycloid[R, #] & /@ Range[π/12, t, π/6]]}
}]
],
ImageSize -> 600,
PlotRange -> {{-2.1 , 3 π + 2.1}, {-2.9, 2.2}}
]
],
{t, 0., 3. π}, {{R, 2}, 0., 2.},
Initialization :> (
cycloid[rad_, θ_] := {θ, 0} +
rad {Cos[-π/2 - θ], Sin[-π/2 - θ]};
circle[ctr_, rad_, θ_] :=
ctr + rad {Cos[-π/2 - θ], Sin[-π/2 - θ]};)
]