Next Previous Up Contents
Next: Strings
Up: Functions
Previous: Shapes

10.6.15 Sky

Functions useful for working with shapes on a sphere. All angles are expressed in degrees.

skyDistance( lon1, lat1, lon2, lat2 )
Calculates the separation (distance around a great circle) of two points on the sky in degrees.

This function is identical to skyDistanceDegrees in class CoordsDegrees.

midLon( lon1, lon2 )
Determines the longitude mid-way between two given longitudes. In most cases this is just the mean of the two values, but this function copes correctly with the case where the given values straddle the lon=0 line.

midLat( lat1, lat2 )
Determines the latitude midway between two given latitudes. This simply returns the mean of the two values, but is supplied for convenience to use alongside the midLon function.

inSkyPolygon( lon0, lat0, lonLats, ... )
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.


Next Previous Up Contents
Next: Strings
Up: Functions
Previous: Shapes

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk