Re: How show Locator point and its image under a function?
- To: mathgroup at smc.vnet.net
- Subject: [mg79963] Re: How show Locator point and its image under a function?
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 9 Aug 2007 05:32:33 -0400 (EDT)
- Organization: Uni Leipzig
- References: <200708070532.BAA12064@smc.vnet.net> <f9c0jv$5st$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi,
f[{x_, y_}] := {(2 x + 1), y + 2}
DynamicModule[{lst = {{-1, 1/2}}},
Row[{LocatorPane[Dynamic[lst],
Framed@ Graphics[{}, PlotRange -> 10, ImageSize -> 300],
LocatorAutoCreate -> True],
Framed@
Graphics[{RGBColor[1, 0, 0], Dynamic[Point[f[#]] & /@ lst]},
PlotRange -> 10, ImageSize -> 300]}
]
]
should work.
Regards
Jens
Murray Eisenberg wrote:
> I oversimplified my requirements...
>
> Actually, I want to do more: I want to include a LocatorAutoCreate->All
> option for the left-hand graphics portion so that as each point there is
> clicked it remains there and its image in the right-hand graphics is
> automatically shown an remains showing even as I click new points on the
> left.
>
> Murray Eisenberg wrote:
>> The following code displays a fixed point and its image under a
>> specified function f:
>>
>> f[{x_,y_}]:={2x+1,y+2}
>> Module[{pt = {-1, 0.5}},
>> Row[{
>> Framed@Graphics[Point[pt], PlotRange -> 5],
>> Framed@Graphics[Point[f[pt]], PlotRange -> 5]
>> }]
>> ]
>>
>> Now I want to have the point in the left-hand graphic to be dynamic,
>> controlled by a Locator, and to have its changed image under the
>> function to be shown in the right-hand graphic.
>>
>> The idea is something like the following (WRONG!) code:
>>
>> DynamicModule[{pts={{0,0}}},
>> Row[{
>> LocatorPane[Dynamic[pts],Graphics[{},PlotRange->5]],
>> Graphics[Dynamic[f/@pts],PlotRange->5]
>> }]
>> ]
>>
>> That code produces error messages, "1 is not a Graphics primitive or
>> directive", "2 is not a Graphics primitive or directive".
>>
>> How can it actually be done?
>>
>
- References:
- How show Locator point and its image under a function?
- From: Murray Eisenberg <murray@math.umass.edu>
- How show Locator point and its image under a function?