# 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...

• 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.'s ennui Apr 4 '17 at 16:10
• @C.E. Ah, I see! My browser was not showing me this before, for some reason - I did not have any doubt that the question was not exactly new... – Igor Rivin Apr 4 '17 at 16:37
• 29888, 47221 etc. – Kuba Apr 4 '17 at 17:29