MathGroup Archive 2012

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

Search the Archive

Constraining locators on a dynamically updated object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127405] Constraining locators on a dynamically updated object
  • From: Brentt <brenttnewman at gmail.com>
  • Date: Sun, 22 Jul 2012 04:33:26 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hello,

I was having an issue with dynamic that I can't seem to puzzle out.  I have
two locators constrained on a circle. I want at least one locator to
control the circle's radius which both are constrained on (it'd be nice if
both did, but one step at a time). My almost working code is this:

DynamicModule[{rad = {1, 0}, pos = {0, 1}},
 Graphics[{Circle[{0, 0}, Dynamic[Norm[rad]]], Locator[Dynamic[rad]],
   Locator[Dynamic[pos, (pos = Norm[rad] Normalize[#1]) &]]}]
 ]

It mostly does what I want except, the locator that doesn't control the
circle's radius doesn't keep on the circle until i click on it. What is
going on here?



  • Prev by Date: Re: How to Scale and vary plot for a Differential Equation
  • Next by Date: Re: How to Scale and vary plot for a Differential Equation
  • Previous by thread: information about locator and dynamic
  • Next by thread: Programmatically open palette so that PalettesMenuSettings are preserved