After thinking about Roger Uribe's question on testing whether points are inside
a polygon on the Earth's surface, I suspect that the best solution is to stereo-
graphically project the points to be tested and the polygon from one of the Earth's
poles. If the points to be tested are given in terms of latitude and longitude,
and if position in the plane of projection is defined in terms of the
prime meridian direction and a perpendicular direction, the
projection won't be harder than converting to three dimensions.
If the points are already given in three dimensions, the projection is
easier. The sides of the polygon project to arcs of circles, and the inside
of the projection of the polygon is defined by the squares of the magnitudes
of the distances from the centers of the circles being less or greater than
some quantities calculated from the polygon. An additional circle can, of
course, be used to exclude those points which aren't close to the polygon.
Peter Kammeyer
U.S. Naval Observatory