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

  • $\begingroup$ 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. $\endgroup$
    – C. E.
    Commented Apr 4, 2017 at 16:04
  • $\begingroup$ 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). $\endgroup$ Commented Apr 4, 2017 at 16:10
  • $\begingroup$ @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... $\endgroup$
    – Igor Rivin
    Commented Apr 4, 2017 at 16:37
  • $\begingroup$ 29888, 47221 etc. $\endgroup$
    – Kuba
    Commented Apr 4, 2017 at 17:29


Browse other questions tagged or ask your own question.