public class LatLonPoints extends Object
Constructor and Description |
---|
LatLonPoints() |
Modifier and Type | Method and Description |
---|---|
static boolean |
betweenLon(double lon,
double lonBeg,
double lonEnd)
Test if point lies between two longitudes, deal with wrapping.
|
static boolean |
isInfinite(ProjectionPoint pt)
See if either coordinate in
pt is +/- infinite. |
static double |
latNormal(double lat)
Normalize the latitude to lie between +/-90
|
static String |
latToString(double lat,
int ndec)
Make a nicely formatted representation of a latitude, eg 40.34N or 12.9S.
|
static double |
lonDiff(double lon1,
double lon2)
Find difference (lon1 - lon2) normalized so that maximum value is += 180.
|
static double |
lonNormal(double lon)
Normalize the longitude to lie between +/-180
|
static double |
lonNormal(double lon,
double center)
put longitude into the range [center +/- 180] deg
|
static double |
lonNormal360(double lon)
put longitude into the range [0, 360] deg
|
static double |
lonNormalFrom(double lon,
double start)
put longitude into the range [start, start+360] deg
|
static String |
lonToString(double lon,
int ndec)
Make a nicely formatted representation of a longitude, eg 120.3W or 99.99E.
|
static double |
range180(double lon)
put longitude into the range [-180, 180] deg
|
static String |
toString(LatLonPoint pt,
int sigDigits)
String representation in the form, eg 40.23N 105.1W
|
public static boolean betweenLon(double lon, double lonBeg, double lonEnd)
lon
- point to testlonBeg
- beginning longitudelonEnd
- ending longitudepublic static boolean isInfinite(ProjectionPoint pt)
pt
is +/- infinite.
This happens sometimes in projective geometry.pt
- point to checkpublic static double latNormal(double lat)
lat
- north latitude in degreespublic static String latToString(double lat, int ndec)
lat
- the latitude.ndec
- number of digits to right of decimal pointpublic static double lonDiff(double lon1, double lon2)
lon1
- startlon2
- endpublic static double lonNormal(double lon)
lon
- east latitude in degreespublic static double lonNormal(double lon, double center)
lon
- lon to normalizecenter
- center pointpublic static double lonNormal360(double lon)
lon
- lon to normalizepublic static double lonNormalFrom(double lon, double start)
lon
- lon to normalizestart
- starting pointpublic static String lonToString(double lon, int ndec)
lon
- the longitude.ndec
- number of digits to right of decimal pointpublic static double range180(double lon)
lon
- lon to normalizepublic static String toString(LatLonPoint pt, int sigDigits)
pt
- the LatLonPointsigDigits
- significant digits