2
$\begingroup$

I want to draw Locator on circle[{m,n},r].

The follwing point p is free Locator. How to draw Locator on Circle[{m,n},r] ?

Manipulate[  
 Show[Graphics[ {Circle[o, r], 
                {PointSize[0.02], Red, Point[o], Locator[Dynamic@o, None]},
                {PointSize[0.02], Blue, Point[p], Locator[Dynamic@p, None]} }]
      , Axes -> True, PlotRange -> 5],
 {{r, 1}, 0.5, 2, 0.1},
 {{o, {1, 1}}, {-2, -2}, {2, 2}, ControlType -> None},
 {{p, {2, 1}}, {-2, -2}, {2, 2}, ControlType -> None} ]
$\endgroup$
3
$\begingroup$

For example:

p[c_, r_, pt_] := c + r  Normalize[pt - c];
DynamicModule[{pt = {3, 0}, c = {0, 0}, r = 3},
 Column[{
   Slider[Dynamic[r, (r = #; pt = p[c, r, pt]) &], {1, 3}],
   Graphics[{
     Dynamic@Circle[c, r],
     Locator[Dynamic[pt, (pt = p[c, r, #]) &]],
     Locator[Dynamic[c, (c = #; pt = p[c, r, pt]) &]]},
     Axes -> True, PlotRange -> 8]}]]

enter image description here

| improve this answer | |
$\endgroup$

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