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


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

Constraining locators on a dynamically updated object

From Brentt <brenttnewman@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Constraining locators on a dynamically updated object
Date 2012-07-22 08:34 +0000
Message-ID <jugdvb$eqr$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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?

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


Thread

Constraining locators on a dynamically updated object Brentt <brenttnewman@gmail.com> - 2012-07-22 08:34 +0000

csiph-web