MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Tracking point on a plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76929] Tracking point on a plot
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Wed, 30 May 2007 05:20:39 -0400 (EDT)

I want a locator on the plot of, say, Sin[x], that will move only
along the graph of the function.  How should this be done?

The closest I've come so far is the following, where the x-coordinate
is being read from wherever the mouse is, but the corresponding
{x,Sin[x]} point on the curve is where the locator appears:

  DynamicModule[{p=0},
    LocatorPane[{Dynamic[p],Dynamic[Sin[p]]},
         Plot[Sin[x],{x,0,10}]
       ]
    ]

(Also, onece the expression is evaluated, each time I move the mouse I
get a Set::write message about Tag Sin in Sin[...] being protected.)

-- 
  Murray Eisenberg                       Internet:  murray at math.umass.edu
  Mathematics & Statistics Dept.            Voice:  413-545-2859 (W)
  University of Massachusetts                       413-549-1020 (H)
  Amherst, MA 01003                           Fax:  413-545-1801


  • Prev by Date: Re: Polynomial to List
  • Next by Date: Re: $10K Mathematica Machine
  • Previous by thread: Re: Tracking point on a plot (follow-up)
  • Next by thread: Re: Tracking point on a plot