public class Sky extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
inSkyEllipse(double lon0,
double lat0,
double lonCenter,
double latCenter,
double rA,
double rB,
double posAng)
Tests whether a given sky position is inside a given ellipse.
|
static boolean |
inSkyPolygon(double lon0,
double lat0,
double... lonLats)
Tests whether a given sky position is inside the polygon defined
by a given set of vertices.
|
static double |
midLat(double lat1,
double lat2)
Determines the latitude midway between two given latitudes.
|
static double |
midLon(double lon1,
double lon2)
Determines the longitude mid-way between two given longitudes.
|
static double |
skyDistance(double lon1,
double lat1,
double lon2,
double lat2)
Calculates the separation (distance around a great circle) of
two points on the sky in degrees.
|
public static double skyDistance(double lon1, double lat1, double lon2, double lat2)
This function is identical to skyDistanceDegrees
in class CoordsDegrees
.
lon1
- point 1 longitude in degreeslat1
- point 1 latitude in degreeslon2
- point 2 longitude in degreeslat2
- point 2 latitude in degreespublic static double midLon(double lon1, double lon2)
lon1
- first longitude in degreeslon2
- second longitude in degreespublic static double midLat(double lat1, double lat2)
midLon
function.lat1
- first latitude in degreeslat2
- second latitude in degreespublic static boolean inSkyEllipse(double lon0, double lat0, double lonCenter, double latCenter, double rA, double rB, double posAng)
lon0
- test point longitude in degreeslat0
- test point latitude in degreeslonCenter
- ellipse center longitude in degreeslatCenter
- ellipse center latitude in degreesrA
- ellipse first principal radius in degreesrB
- ellipse second principal radius in degreesposAng
- position angle in degrees from the North pole
to the primary axis of the ellipse in the direction
of increasing longitudepublic static boolean inSkyPolygon(double lon0, double lat0, double... 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
- test point latitude in degreeslat0
- test point longitude in degreeslonLats
- 2N arguments (lon1
, lat1
,
lon2
, lat2
, ...,
lonN
, latN
)
giving (longitude, latitude) vertices of
an N-sided polygon in degreesCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.