Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11026 > unrolled thread
| Started by | Brentt <brenttnewman@gmail.com> |
|---|---|
| First post | 2012-07-22 08:34 +0000 |
| Last post | 2012-07-22 08:34 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Constraining locators on a dynamically updated object Brentt <brenttnewman@gmail.com> - 2012-07-22 08:34 +0000
| From | Brentt <brenttnewman@gmail.com> |
|---|---|
| Date | 2012-07-22 08:34 +0000 |
| Subject | Constraining locators on a dynamically updated object |
| Message-ID | <jugdvb$eqr$1@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?
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web