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


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

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

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Can a Locator be Made to Track a Curve?
Date 2011-08-10 10:51 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j1tnsb$pos$1@smc.vnet.net> (permalink)
References <201108060612.CAA13010@smc.vnet.net>

Show all headers | View raw


I don't see anything unexpected, using the code below.

The function derivative is high (relative to the scale of the plot) in  
that region, so {x, f@x} is sensitive to the value of x, and hence, it's  
difficult to place the cursor precisely where you want it. I never saw it  
get "stuck".

Bobby

On Tue, 09 Aug 2011 06:19:45 -0500, E. Martin-Serrano  
<eMartinSerrano@telefonica.net> wrote:

> Try this slightly modified version and  see what happens for  0<x< 1
>
> locator =   Graphics[{Red, Disk[{0, 0}, Offset[3]], Black,  Circle[{0,  
> 0},
> Offset[3]], Circle[{0, 0}, Offset[6]] },   ImageSize -> 30];
>
> f[x_] := Sin[x] E^-x;
> g[{x_, _}] := {x, f@x}
> pt = {0, 0};
> LocatorPane[Dynamic[pt, (pt = g@#) &], Plot[f[x], {x, 0, 2 Pi}],   
> Appearance
> -> locator]
>
> The locator tends to go out of control  for 0<x< 1.  I observed this,  
> say,
> abnormal  behavior for all versions posted;  after changing f[x_] :=  
> Sin[x]
> to   f[x_] := Sin[x] E^-x. It seems the problem is not related to the
> inclusion of the tailored locator (works the same for the built in one).
> Sometimes the locator tends to jump or get stuck within 0<x< 1 range.
>
>
> -----Mensaje original-----
> De: DrMajorBob [mailto:btreat1@austin.rr.com]
> Enviado el: lunes, 08 de agosto de 2011 10:21
> Para: mathgroup@smc.vnet.net
> Asunto: Re: Can a Locator be Made to Track a Curve?
>
> A bit simpler, I think, is:
>
> f[x_] := Sin[x];
> g[{x_, _}] := {x, f@x}
> pt = {0, 0};
> LocatorPane[Dynamic[pt, (pt = g@#) &], Plot[Sin[x], {x, 0, 2 Pi}]]
>
> Bobby
>
> On Sun, 07 Aug 2011 05:14:52 -0500, Heike Gramberg
> <heike.gramberg@gmail.com> wrote:
>
>> You could do something like
>>
>> f[x_] := Sin[x];
>> pt = {0, 0};
>> LocatorPane[Dynamic[pt, (pt[[1]] = #[[1]]; pt[[2]] = f[#[[1]]]) &],
>> Plot[Sin[x], {x, 0, 2 Pi}]]
>>
>> Heike
>>
>> On 6 Aug 2011, at 08:12, Gregory Lypny wrote:
>>
>>> Hello everyone,
>>>
>>> Can a locator be constrained so that it tracks a curve?
>>>
>>> Regards,
>>>
>>> Gregory
>>>
>>
>>
>
>
> --
> DrMajorBob@yahoo.com
>
>


-- 
DrMajorBob@yahoo.com

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


Thread

Re: Can a Locator be Made to Track a Curve? DrMajorBob <btreat1@austin.rr.com> - 2011-08-10 10:51 +0000

csiph-web