# Constraining locators [duplicate]

Is there any canonical way to constrain locators either continuously (e.g. to lie on the graph of a function) or discretely (snap to grid leaps to mind)? The documentation seems a little sketchy on the subject...

## marked as duplicate by C. E., Community♦Apr 4 '17 at 18:53

• Please look at the questions under "related" in the right column on this page. This has been done many times before using the second argument of Dynamic. – C. E. Apr 4 '17 at 16:04
• For a curve represented as an implicit Cartesian equation, I used RegionNearest[] for this answer. If you need locators to be constrained to a function, see this (a similar approach should work for parametrically-defined curves). – J. M. will be back soon Apr 4 '17 at 16:10