i have a typical question with the Geometric datatype of mysql, polygon.
I have the polygon data, in the form of an array of latitudes and longitudes, ex:
Here's a possible algorithm.
Writing the code is left as an exercise. :)