Referring to this link I happen to realize that actually the trace being projected is dependent on an equation and not on disk or circle. Though I was presuming that it is getting traced because of the movement of circle/disk. So, in mathematica is it possible that the object can be traced automatically, say the same output of cycloid program without using parametric equations for trace of point on circle.
Asked
Active
Viewed 1,541 times
6
1 Answers
9
h = {Disk[], Red, PointSize[Large], Point[{1, 0}]};
r = Image@Total[ImageData /@ (ColorSeparate /@
Table[
Graphics[{Translate[Rotate[h, - 2 t/(Pi)], {t, 0}]},
PlotRange -> {{0, 6 Pi}, {-1, 1}}, Background -> Black],
{t, 0, 6 Pi, 2 Pi/20}])[[All, 1]]]


Edit (Perhaps cleaner)
(*the object to trace*)
h = {Disk[], Red, PointSize[Medium], Point[{1, 0}]};
obj[t_, col_] := Graphics[Translate[Rotate[h, -2 t/(Pi)], {t, 0}],
PlotRange -> {{0, 6 Pi}, {-1, 1}}, Background -> col];
dt = Pi/20;
tr[0, dt] = First@ColorSeparate[obj[0, Black]];
tr[t_, dt_] := tr[t, dt] = ImageAdd[tr[t - dt, dt], First@ColorSeparate[obj[t, Black]]];
Animate[ ImageCompose[ImageMultiply[tr[t, dt], Red], {obj[t, White], .6}], {t, 0, 6 Pi, 2 Pi/20}]

Dr. belisarius
- 115,881
- 13
- 203
- 453
-
Is your code supposed to show the rotating disk with the red dot (from the bottom half of the figure in your post) too? Because I'm only getting the cycloid trace. – Aky May 12 '13 at 08:37
-
Disk[]in the graph. Ideally you'd need a way to tag the points you may want to extract later but I don't think there is a way to attach such labels to Mathematica Graphics elements. One possible solution would be toSow[]the information as you build up the plot, thenReap[]the information you need later if you choose to. – SEngstrom May 11 '13 at 16:16