Function inSkyPolygon( lon0, lat0, lonLats, ... )

Description:
Tests whether a given sky position is inside the polygon defined by a given set of vertices. The bounding lines of the polygon are the minor arcs of great circles between adjacent vertices, with an extra line assumed between the first and last supplied vertex. The interior of the polygon is defined to be the smaller of the two regions separated by the boundary. The vertices are specified as a sequence of loni, lati pairs.

The implementation of this point-in-polygon function is mostly correct, but may not be bulletproof. It ought to work for relatively small regions anywhere on the sky, but for instance it may get the sense wrong for regions that extend to cover both poles.

Parameters:
lon0 (floating point)
test point latitude in degrees
lat0 (floating point)
test point longitude in degrees
lonLats (floating point, one or more)
2N arguments (lon1, lat1, lon2, lat2, ..., lonN, latN) giving (longitude, latitude) vertices of an N-sided polygon in degrees
Return Value (boolean):
true iff test point is inside, or on the border of, the polygon
Signature:
boolean inSkyPolygon(double, double, double...)