Me Science Music Programming Games Business Misc

The Area Enclosed By A Perimeter Problem

If you wish to skip straight to the math, here is the LaTeX typeset article I wrote on the subject.

One day during my sophomore year of college, I was walking through the campus with my best friend. She was working in some geography research of some sort, and found that she ran herself into a problem:

She needed to be able to write a little program to find the area of geological features based by drawing a polygon around the feature.

This intrigued me, but with my limited mathematical knowledge at the time (I had not made it to vector calclus yet), I was only able to offer useless advice on how to solve the problem.

In the years that followed that conversation, I had largely forgotten about the problem, distracted by more important things such as quantum mechanics and relativity. But every so often the thought of the problem would drift back into my mind--not so much that I ever cared to put any thought into it--just so much that I could never completely get it out of my mind.

And so it went for seven years, when one day, while standing in the shower (feeling a little dizzy from a flu) it occured to me: "I'm an idiot! Use Stoke's Theorem!"

For those of you unfamiliar with Stoke's Theorem, it is a little equation from vector calculus that relates a quantity relating to a closed path in a vector field, to another quantity relating to the area enclosed by that path in the vector field. It's so obvious! The equation relates the area to the perimeter if only I choose the vector field to be just right.

Fortunately, it is relatively easy to calculate this vector field in ones head--just find a vector field who's curl is a vector that points perpendicular to the plane the figure is in, and has magnitutde one.

With little effort, I found a simple integral, which was so simple that I was able to use it to find the area of a few simple shapes, such as translated squares and triangles, all in my head! After doing a few simple calculations while staring at the glass shower door, I found that the equations were working!

When I got out of th shower, I could hardly wait to finish generalizing the equations for use in the original geography problem. To my surprise, the answer was extremely simple (though not intuitive by any means): Simply sum a contribution from each side of the polygon to find the area. This contribution is equal to the x-coordinate of the midpoint of the side, multiplied by the change in y-coordinate from the beginning to the end of the polygon (keeping in mind that this value can, and often is, negative).

If you wish to see the math of this in more detail, check out the LaTeX typeset article I wrote on the subject.

(c)2005, Jeff Reinecke.
Questions or Comments? Mail me.