Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4205

Re: Can a Locator be Made to Track a Curve?

From "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Can a Locator be Made to Track a Curve?
Date 2011-08-07 10:19 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j1los8$nnv$1@smc.vnet.net> (permalink)
References <j1im6k$co2$1@smc.vnet.net>

Show all headers | View raw


On Sat, 06 Aug 2011 07:15:48 +0100, Gregory Lypny  
<gregory.lypny@videotron.ca> wrote:

> Hello everyone,
>
> Can a locator be constrained so that it tracks a curve?
>
> Regards,
>
> Gregory
>

Yes:

f = Sin;
DynamicModule[{p = {0, f[0]}},
  Show[{
    Plot[f[x], {x, -Pi, Pi}],
    Graphics@
     Locator@Dynamic[
       p, (p = Through@{First, Composition[f, First]}@#) &]
    }]
  ]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Can a Locator be Made to Track a Curve? Gregory Lypny <gregory.lypny@videotron.ca> - 2011-08-06 06:15 +0000
  Re: Can a Locator be Made to Track a Curve? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-08-07 10:19 +0000

csiph-web