0
$\begingroup$

TrackingFunction example

Manipulate[
 Graphics[Circle[], PlotRange -> 2], 
 {{pt, {0, 0}}, Locator, TrackingFunction -> (pt = #/Max[Norm[#], 1]; &)}]

works

but when I add one Locator, no constraint is imposed on two Locators.

Manipulate[Graphics[Circle[], PlotRange -> 2]
 
 , {{pt, {0, 0}}, Locator, TrackingFunction -> (pt = {#[[1]], 0}; &)}
 , {{pt1, {0, 2}}, Locator, TrackingFunction -> (pt1 = {#[[1]], 2}; &)}
 ]
$\endgroup$
1

1 Answer 1

1
$\begingroup$

You may use a "LocatorPane" for several locators. But it seems simpler to use an array of locators like:

Manipulate[Graphics[Circle[], PlotRange -> 2]
 , {{pt, {{0, 0}, {0, 1.5}}}, Locator, 
  TrackingFunction -> (pt = {{#[[1, 1]], 0}, {#[[2, 1]], 1.5}}; &)}
 ]

enter image description here

$\endgroup$

Your Answer

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

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