Let me start with this example from the WLDC:
Dynamic[ ] > Applications > 1st example:
Constrain the coordinates of a point to lie on a circle:
DynamicModule[{p = {0, 1}}, Graphics[{
Dashed
, Circle[]
, PointSize[0.1]
, Point[
Dynamic[p, (p = Normalize[#]) &]
]
}, PlotRange -> 1.2, Axes -> True, ImageSize -> Tiny]
]
Comments:
- The text is clear, it makes the intention clear. Or at least I think so. Well, I am
understanding: We want to constrain a (given? any? dynamically
given? interactively given?) point to lie on the circle (radius 1,
center at {0,0}).
- Where can we observe the dynamics? Or where is the interactivity? The initial point is given with {0,1}. This point already lies on
the unit circle! And the point cannot be moved or anything with my mouse. So i
really don't see any dynamics or interactivity here.
- To constrain a point to lie on a circle with some dynamics, maybe
the function Locator[ ] should have been used in the code?
- Maybe this example is not to demo interactivity with the mouse or any kind of dynamics? However, edit the code and use the point p = {-1, 1} in the module initialization. You will see that the point is drawn outside the circle, i.e. neither the function Dynamic[ ] nor Normalize[ ] do their job. Seems like.
At this point it is impossible for me to suggest an improved code and/or text which makes this example (input and output) clearer to the reader, because i clearly seem to be missing something. What am i missing here?