Re: Motion
- To: mathgroup at smc.vnet.net
- Subject: [mg78405] Re: Motion
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 30 Jun 2007 06:11:52 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f62l97$cek$1@smc.vnet.net>
Tim Brophy wrote:
> Hi everybody,
>
> I am trying to draw circles that will stay centered on a Locator and
> increase in size. I thought that this code might work. What am I
> doing wrong?
>
> DynamicModule[{p = {0, 0}},
> LocatorPane[Dynamic[p],
> Dynamic[
> Animate[
> Graphics[Circle[p, t], PlotRange -> {{-7, 7}, {-7, 7}}], {t, 0,
> 6}]]]]
>
> Tim Brophy
Tim,
The following code will do what you want. Note that *Animate* must
enclose *LocatorPane*. Also, I have added a *Dynamic* function inside
*Circle*.
DynamicModule[{p = {0, 0}},
Animate[
LocatorPane[Dynamic[p],
Graphics[Circle[Dynamic[p], t], PlotRange -> {{-7, 7}, {-7, 7}}]],
{t, 0, 7}]]
Regards,
Jean-Marc