What this example code from https://reference.wolfram.com/language/ref/Dynamic.html (under Applications section the first example) should teach us?

 (* 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[#]) &]]}, ImageSize -> Tiny, 
  PlotRange -> 1.2]]

enter image description here

I see nothing dynamic on the output. Even when I use p = {0, 1/2} instead of p = {0, 1} the point does not lie on the circle (no normalization of point p occur).

  • 3
    $\begingroup$ If you enter the above and then double click (and then drag the black dot around), it moves, constrained to the circle. $\endgroup$
    – bill s
    Dec 3, 2022 at 18:30
  • $\begingroup$ This is really unexpected. They should have mention it in the description - i.e. what to do to test it. $\endgroup$ Dec 3, 2022 at 18:34
  • $\begingroup$ It's a graphic object -- one way to interact with a graphics objects is use the mouse. But surely you are correct that it would be better to explain it! $\endgroup$
    – bill s
    Dec 3, 2022 at 18:38
  • $\begingroup$ I thought double clicking on static 2D was meant only for manually editing it. Unlike when using on 3D graphics to rotate scene. $\endgroup$ Dec 3, 2022 at 18:40

1 Answer 1


Another example work.

DynamicModule[{pt = {0, 1}}, 
  Graphics[{Dashed, Circle[], PointSize[Large], 
    Dynamic[Point[Normalize[pt]]]}], Appearance -> None]]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.