public class LatLonGeo extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static DatumSphere |
defaultDatum |
static LatLonFormat |
defaultFormat |
Constructor and Description |
---|
LatLonGeo(double northLatDeg,
double eastLonDeg)
Constructs and initializes a
LatLonGeo at the given coordinates. |
LatLonGeo(double northLatDeg,
double eastLonDeg,
double altitude)
Constructs and initializes a
LatLonGeo at the given coordinates. |
Modifier and Type | Method and Description |
---|---|
LatLonGeo |
displacedBy(DistanceAzimuth distAzimuth) |
LatLonGeo |
displacedBy(DistanceAzimuth distAzimuth,
Datum datum) |
LatLonGeo |
displacedBy(double dist,
double azimuth)
Same as
displacedBy(double, double, Datum) , only
the default datum is used instead of a user-supplied datum. |
LatLonGeo |
displacedBy(double dist,
double azimuth,
Datum datum)
Returns a newly constructed
LatLonGeo generated
by displacing this LatLonGeo a specified distance
along a geodesic at the given azimuth. |
boolean |
equals(Object obj) |
String |
format(String componentFormat) |
String |
formatDeg(String componentFormat) |
String |
formatRad(String componentFormat) |
static LatLonGeo |
fromDeg(double northLat,
double eastLon)
Constructs and initializes a
LatLonGeo at the given coordinates. |
static LatLonGeo |
fromDeg(double northLat,
double eastLon,
double altitude)
Constructs and initializes a
LatLonGeo at the given coordinates. |
static LatLonGeo |
fromDeg(int northLatHours,
double northLatMinutes,
int eastLonHours,
double eastLonMinutes)
Constructs and initializes a
LatLonGeo at the given coordinates. |
static LatLonGeo |
fromEnu(Vector3d enuPoint,
LatLonGeo refPoint,
Datum datum)
Constructs and initializes a
LatLonGeo based on the given
(east,north,up) coordinates in a local tangent plane coordinate system that is
tangent to Earth at the given reference point. |
static LatLonGeo |
fromRad(double northLat,
double eastLon)
Constructs and initializes a
LatLonGeo at the given coordinates. |
static LatLonGeo |
fromRad(double northLat,
double eastLon,
double altitude)
Constructs and initializes a
LatLonGeo at the given coordinates. |
double |
getAltitude() |
double |
getAzimuthFrom(LatLonGeo from) |
double |
getAzimuthFrom(LatLonGeo from,
Datum datum) |
double |
getAzimuthTo(LatLonGeo to) |
double |
getAzimuthTo(LatLonGeo to,
Datum datum) |
DistanceAzimuth |
getDistanceAzimuthTo(LatLonGeo to) |
DistanceAzimuth |
getDistanceAzimuthTo(LatLonGeo to,
Datum datum) |
double |
getDistanceTo(LatLonGeo to) |
double |
getDistanceTo(LatLonGeo to,
Datum datum) |
double |
getLatDeg() |
double |
getLatRad() |
double |
getLonDeg() |
double |
getLonRad() |
int |
hashCode() |
static double |
normalizeAnglePi(double rad)
Normalizes an angle to lie within [-π,π) radians.
|
static double |
normalizeLat(double latRad)
Normalizes a latitude to be in the range [-π/2,π/2] radians.
|
static double |
normalizeLon(double lonRad)
Normalizes a longitude to be in the range [-π,π) radians.
|
Vector3d |
toEnu(LatLonGeo refPoint,
Datum datum)
Creates an (east,north,up) representation of this point on the plane
tangent to Earth at the given reference point.
|
LatLonRect |
toLatLonRect(Datum datum)
Treats this
LatLonGeo as an ECEF-g coordinate in the given
Datum for the purpose of converting it to an ECEF-r coordinate
in the form of a newly constructed LatLonRect . |
String |
toString() |
String |
toString(LatLonFormat latLonFormat) |
LatLonGeo |
withAltitude(double altitude)
Returns a newly constructed
LatLonGeo with a
new altitude but same latitude and same longitude as the current
LatLonGeo . |
LatLonGeo |
withGeocentricLatitudeOn(Datum d)
Returns a newly constructed
LatLonGeo with
a geocentric latitude based on interpreting the latitude
in this LatLonGeo as geodetic. |
LatLonGeo |
withGeodeticLatitudeOn(Datum d)
Returns a newly constructed
LatLonGeo with
a geodetic latitude based on interpreting the latitude
in this LatLonGeo as geocentric. |
public static final LatLonFormat defaultFormat
public static final DatumSphere defaultDatum
public LatLonGeo(double northLatDeg, double eastLonDeg)
LatLonGeo
at the given coordinates. Altitude
will default to 0.northLatDeg
- north latitude in degrees of the newly constructed LatLonGeo
eastLonDeg
- east longitude in degrees of the newly constructed LatLonGeo
public LatLonGeo(double northLatDeg, double eastLonDeg, double altitude)
LatLonGeo
at the given coordinates.northLatDeg
- north latitude in degrees of the newly constructed LatLonGeo
eastLonDeg
- east longitude in degrees of the newly constructed LatLonGeo
altitude
- altitude in system units of the newly constructed LatLonGeo
fromDeg(double,double,double)
,
fromDeg(double,double)
,
fromRad(double,double,double)
,
fromRad(double,double)
public static LatLonGeo fromDeg(int northLatHours, double northLatMinutes, int eastLonHours, double eastLonMinutes)
LatLonGeo
at the given coordinates.northLatHours
- hours of north latitude (degrees) in new LatLonGeo
northLatMinutes
- minutes of north latitude (degrees) in new LatLonGeo
eastLonHours
- hours of east longitude (degrees) in new LatLonGeo
eastLonMinutes
- minutes of east longitude (degrees) in new LatLonGeo
public static LatLonGeo fromDeg(double northLat, double eastLon, double altitude)
LatLonGeo
at the given coordinates.northLat
- north latitude in degrees of the newly constructed LatLonGeo
eastLon
- east longitude in degrees of the newly constructed LatLonGeo
altitude
- altitude in system units of the newly constructed LatLonGeo
public static LatLonGeo fromDeg(double northLat, double eastLon)
LatLonGeo
at the given coordinates. Altitude
will default to 0.northLat
- north latitude in degrees of the newly constructed LatLonGeo
eastLon
- east longitude in degrees of the newly constructed LatLonGeo
public static LatLonGeo fromRad(double northLat, double eastLon, double altitude)
LatLonGeo
at the given coordinates.northLat
- north latitude in radians of the newly constructed LatLonGeo
eastLon
- east longitude in radians of the newly constructed LatLonGeo
altitude
- altitude in system units of the newly constructed LatLonGeo
public static LatLonGeo fromRad(double northLat, double eastLon)
LatLonGeo
at the given coordinates. Altitude
will default to 0.northLat
- north latitude in radians of the newly constructed LatLonGeo
eastLon
- east longitude in radians of the newly constructed LatLonGeo
public static final LatLonGeo fromEnu(Vector3d enuPoint, LatLonGeo refPoint, Datum datum)
LatLonGeo
based on the given
(east,north,up) coordinates in a local tangent plane coordinate system that is
tangent to Earth at the given reference point.enuPoint
- (east,north,up) coordinates of point to be converted, in system unitsrefPoint
- local tangent plane point of tangencydatum
- underlying datum used for calculationspublic LatLonRect toLatLonRect(Datum datum)
LatLonGeo
as an ECEF-g coordinate in the given
Datum
for the purpose of converting it to an ECEF-r coordinate
in the form of a newly constructed LatLonRect
. The new
LatLonRect
is formed by calling Datum.toLatLonRect(LatLonGeo)
on this LatLonGeo
.
NOTE: The latitude and longitude may be treated as geocentric or geodetic
depending on the Datum
used.
datum
- Datum
used to construct the new LatLonRect
Datum.toLatLonRect(LatLonGeo)
public final Vector3d toEnu(LatLonGeo refPoint, Datum datum)
Datum.toEnu(LatLonRect, LatLonGeo)
.public double getAltitude()
public double getLatRad()
public double getLonRad()
public double getLatDeg()
public double getLonDeg()
public LatLonGeo withAltitude(double altitude)
LatLonGeo
with a
new altitude but same latitude and same longitude as the current
LatLonGeo
.altitude
- altitude of the newly constructed LatLonGeo
public LatLonGeo withGeodeticLatitudeOn(Datum d)
LatLonGeo
with
a geodetic latitude based on interpreting the latitude
in this LatLonGeo
as geocentric. Longitude
and altitude will remain the same. See
Datum.toGeodeticLatitude(LatLonGeo)
.d
- Datum defines the spheroid used for projecting the latitudeLatLonGeo
with a geodetic latitudepublic LatLonGeo withGeocentricLatitudeOn(Datum d)
LatLonGeo
with
a geocentric latitude based on interpreting the latitude
in this LatLonGeo
as geodetic. Longitude
and altitude will remain the same. See
Datum.toGeocentricLatitude(LatLonGeo)
.d
- Datum defines the spheroid used for projecting the latitudeLatLonGeo
with a geocentric latitudepublic LatLonGeo displacedBy(double dist, double azimuth, Datum datum)
Returns a newly constructed LatLonGeo
generated
by displacing this LatLonGeo
a specified distance
along a geodesic at the given azimuth. If the datum is a
sphere the geodesic is a great circle.
This method calls Datum.displace(LatLonGeo, double, double)
on the supplied datum using this LatLonGeo
as the
initial point.
dist
- distance to displace the current LatLonGeo
azimuth
- initial azimuth of displacement directiondatum
- underlying datum to use for the displacementLatLonGeo
that has been displaced
by the specified distancepublic LatLonGeo displacedBy(double dist, double azimuth)
displacedBy(double, double, Datum)
, only
the default datum is used instead of a user-supplied datum.public LatLonGeo displacedBy(DistanceAzimuth distAzimuth, Datum datum)
public LatLonGeo displacedBy(DistanceAzimuth distAzimuth)
public DistanceAzimuth getDistanceAzimuthTo(LatLonGeo to, Datum datum)
public DistanceAzimuth getDistanceAzimuthTo(LatLonGeo to)
public double getDistanceTo(LatLonGeo to)
public double getAzimuthTo(LatLonGeo to)
public double getAzimuthFrom(LatLonGeo from)
public static final double normalizeLon(double lonRad)
Warning: This method produces a near-infinite loop if argument is a very large value.
public static final double normalizeLat(double latRad)
Warning: This method produces a near-infinite loop if argument is a very large value.
public static final double normalizeAnglePi(double rad)
public String toString(LatLonFormat latLonFormat)
Copyright © 2013 Metron, Inc.. All rights reserved.