New answers tagged

2

Here is some code that will let you vary the shape you are rendering fairly easily but does not use Manipulate. It might be useful to you in the short term. I will put more work in this problem, and try to build a useful interactive version with Manipulate. I will update this answer when I have such code. With[{n = 100}, z = Subdivide[0, 2 Pi, n]; x = ...


2

There are a couple of issues. The floating-point arithmetic could result in a point close to (0, 0) without being equal to (0, 0). Use Chop. The Abort happens after pt is updated in EventHandler . So sequence of events is Press key. Update to (0, 0) (actually, really close to (0, 0)). Not (0, 0), so continue. Press key again. Update to not (0, 0). Not ...


4

Shortly, use a SelectorPane and hide EventHandler as soon as the condition is met: pt = {0, .05}; pane = "dynamic"; graphics = Framed[Graphics[ {{Red, Disk[Dynamic[pt], .1]}}, PlotRange -> 1, Axes -> True] ]; eh = EventHandler[#, { "LeftArrowKeyDown" :> (pt -= {0.05, 0}; check@pt), "RightArrowKeyDown" :> (pt += {0.05, 0}; ...



Top 50 recent answers are included