Re: [math-fun] Interactive virtual planimeter
Try this: areaPolygon[L_List] := Total[MapThread[Im[#1\[Conjugate]*#2] &, {L, RotateLeft[L]}]]/2 pts = {{1, 1}, {9, 6}, {6, 9}}; LocatorPane[Dynamic@pts, Dynamic@Graphics[{Gray, Point[Join @@ Outer[List, Range@9, Range@9]], Red, Polygon@pts}], {{0, 0}, {9, 9}, {1, 1}}, LocatorAutoCreate -> True] Dynamic[areaPolygon[{1, I}.# & /@ pts]] Drag the points around. Create and destroy them with Cmd-left. Plain click seizes nearest. If a new point is out of sequence, permute by sliding things around. It is a bug in Mathematica that clicking a point floats its coordinates. --rwg On 2016-07-29 07:50, James Propp wrote:
Musing some more about the article I want to write, I think the best accompanying interactive demo would be a virtual polar planimeter that only handles polygonal regions with vertices lying on a grid. When you add a vertex, a new triangle is added/subtracted. That would make it clear where the "shoelace" formula comes from. It might also make certain kinds of puzzles/challenges possible.
Jim
On Fri, Jul 29, 2016 at 9:06 AM, Bill Gosper <billgosper@gmail.com> wrote:
It seems to me that planimeters are winding-numberish, based on the formula
areaPolygon[L_List] := Total[MapThread[Im[#1\[Conjugate]*#2] &, {L, RotateLeft[L]}]]/2
whereas Mike's is sort of Riemann-Stieltjesish.
Here's <http://gosper.org/planimeter.pdf> a crude Mathematica attempt at the former. Drag-undrag-drag makes points-linesegment-points.
OOPS, bug in Mathematica's pdf renderer! The top illustration should look like gosper.org/planimeter.png , i.e. winding number mod 2. I'm not sure if Wolfram has a site for running toy programs, but this one seems short enough to be fairly portable. --rwg On 2016-07-26 10:57, Mike Stay wrote:
Here's a cheap one I just whipped up:
https://www.khanacademy.org/computer-programming/planimeter/5456307495501824
On Tue, Jul 26, 2016 at 10:33 AM, James Propp <jamespropp@gmail.com>
wrote:
Does anyone know of a good interactive virtual planimeter that will tell you the signed area of a region that you've specified by dragging around a cursor? Even a version that only works for polygons (where the user clicks successive vertices) would be better than nothing.
I've looked on the web, but I couldn't find what I need. Maybe one of you is inclined to build one? I would feature it (with credit, of course) in my upcoming Mathematical Enchantments essay about signed area (later this year).
I want something that runs from a browser, so readers of my blog can just click on a link and a new tab will open. I am not interested in explaining the mechanics of how physical planimeters work (though I suppose I wouldn't be opposed to a webpage that explained that too, as long as the visuals associated with the wheels and arms didn't submerge the main message). I'd much rather have extra visuals that reinforce the concept of signed area. For instance, if the demo does just polygons, then every time a new vertex gets added, one could see a new triangle joining the new vertex, the previous vertex, and the origin, with shading or color to indicate whether it's oriented clockwise or counterclockwise, and with appropriate cancellation of positive and negative area being represented visually.
It'd be especially nice if the demo handled reentrant polygons sensitively, so that regions encircled m times had a different color than regions encircled n times, when the integers m and n (positive, negative, or zero) are unequal.
Jim Propp
participants (1)
-
Bill Gosper