Tag Info

Hot answers tagged

5

I do nor know how to implement what you want to do in a Manipulate expression using locators, because I don't know how to handle mouse events in a Manipulate expression. However, if you are willing to accept an answer using EventHandler, the behavior you ask for isn't very difficult to implement. With[{δ = .2}, DynamicModule[{p1 = {0, 0}, p2 = {2, 2}, ...


5

This is what I find more intuitive: circle[] := DynamicModule[{a = {0, 0}, b = {1, 0}, r = 1, w}, { Dynamic@Circle[a, r], Locator[Dynamic[a, {(w = b - a) &, (a = #; b = a + w) &, None}]], Locator[Dynamic[b, (b = #; r = Norm[b - a]) &]] }] Graphics[circle[], Frame -> True, PlotRange -> 2] And this is what fits well ...


1

x = {3, 3}; y = {5, 3}; LocatorPane[Dynamic[{x, y}], Dynamic@Graphics[{{Gray, Circle[x, Abs[y[[1]] - x[[1]]]]}, {Blue, PointSize[0.02], Point[{x, {y[[1]], x[[2]]}}]}}, Axes -> True, PlotRange -> {{-2, 8}, {-2, 8}}, AxesOrigin -> {0, 0}], Appearance -> None]



Only top voted, non community-wiki answers of a minimum length are eligible