public class Sky extends Object
Modifier and Type | Method and Description |
---|---|
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 degreesmidLon(204.0, 203.5) = 203.75
, midLon(2, 359) = 0.5
public static double midLat(double lat1, double lat2)
midLon
function.lat1
- first latitude in degreeslat2
- second latitude in degreesmidLat(23.5, 24.0) = 23.75
public 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 © 2022 Central Laboratory of the Research Councils. All Rights Reserved.