Functions useful for working with shapes on a sphere. All angles are expressed in degrees.
skyDistance( lon1, lat1, lon2, lat2 )
This function is identical to skyDistanceDegrees
in class CoordsDegrees
.
lon1
(floating point): point 1 longitude in degreeslat1
(floating point): point 1 latitude in degreeslon2
(floating point): point 2 longitude in degreeslat2
(floating point): point 2 latitude in degreesmidLon( lon1, lon2 )
lon1
(floating point): first longitude in degreeslon2
(floating point): second longitude in degreesmidLon(204.0, 203.5) = 203.75
midLon(2, 359) = 0.5
midLat( lat1, lat2 )
midLon
function.
lat1
(floating point): first latitude in degreeslat2
(floating point): second latitude in degreesmidLat(23.5, 24.0) = 23.75
inSkyPolygon( lon0, lat0, lonLats, ... )
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.
lon0
(floating point): test point latitude in degreeslat0
(floating point): test point longitude in degreeslonLats
(floating point, one or more): 2N arguments (lon1
, lat1
,
lon2
, lat2
, ...,
lonN
, latN
)
giving (longitude, latitude) vertices of
an N-sided polygon in degrees