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$

closed as off-topic by MarcoB, user9660, Karsten 7., Sjoerd C. de Vries, dr.blochwave Nov 17 '15 at 7:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, Community, Sjoerd C. de Vries, dr.blochwave
If this question can be reworded to fit the rules in the help center, please edit the question.

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

$\endgroup$

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