public class EarthVector extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
CEKM |
static int |
DEGREES |
static double |
DPR |
static double |
EARTH_FLATTENING |
static double |
EARTH_ROT_RATE |
static double |
ECF_EPSILON |
protected javax.vecmath.Vector3d |
ecfVector |
protected double |
elevation |
static double |
FLAT_COEFF1 |
static double |
FLAT_COEFF2 |
static double |
FLATTENING_FACTOR |
static double |
FTperKM |
static double |
FTperSM |
static double |
G |
static double |
GM |
static double |
INperKM |
static double |
J2 |
static double |
J3 |
static double |
J4 |
static double |
J5 |
static double |
KMperDegree |
static double |
KMperNM |
static double |
KMperSM |
protected double |
latitude |
protected double |
longitude |
static double |
NMperDegree |
protected boolean |
oblate |
static double |
POLAR_RENM |
static double |
RAD_1 |
static double |
RAD_180 |
static double |
RAD_270 |
static double |
RAD_360 |
static double |
RAD_45 |
static double |
RAD_90 |
static int |
RADIANS |
static double |
REKM |
static double |
RENM |
static int |
SEC_180 |
static int |
SEC_270 |
static int |
SEC_360 |
static int |
SEC_90 |
static double |
SMperKM |
static double |
X_EPSILON |
static double |
Y_EPSILON |
static double |
YDperKM |
| Constructor and Description |
|---|
EarthVector()
Default constructor
|
EarthVector(double inlat,
double inlon)
lat/long (radians) constructor
|
EarthVector(double inlat,
double inlon,
double inelev)
lat/long/elev (radians) constructor
|
EarthVector(double inlat,
double inlon,
double inelev,
int units)
lat/long/elev (radians or degrees) constructor
|
EarthVector(double inlat,
double inlon,
int units)
lat/long (radians or degrees) constructor
|
EarthVector(EarthVector loc)
EarthVector (copy) constructor
|
EarthVector(javax.vecmath.Point2d point)
Point2d (radians) constructor
|
EarthVector(javax.vecmath.Point2d point,
double inelev)
Point2d/elev (radians) constructor
|
EarthVector(javax.vecmath.Point2d point,
double inelev,
int units)
Point2d/elev (degrees or radians) constructor
|
EarthVector(javax.vecmath.Point2d point,
int units)
Point2d (degrees or radians) constructor
|
EarthVector(javax.vecmath.Vector3d vec)
Vector3d (ECF or unit vector) constructor If vector is ECF, elevation is derived from it
Otherwise, elevation is zero
|
EarthVector(javax.vecmath.Vector3d vec,
double inelev)
Vector3d (unit vector)/elev constructor
|
| Modifier and Type | Method and Description |
|---|---|
static double |
degreestoKM(double distDeg,
double latDeg) |
static double |
degToRad(double deg)
Convert degrees to radians
|
boolean |
epsilonEquals(EarthVector otherEv,
double epsilon)
equals - compare ecf position (x,y,z) for equality with an epsilon value
|
boolean |
equals(Object obj)
equals - compare ecf position (x,y,z) for equality
|
EarthVector |
findPoint(double distanceKM,
double azimuth)
Locate a coordinate at a specific distance (km) and heading (radians) from this one.
|
EarthVector |
findPoint(double distanceKM,
double azimuth,
double elevAngle)
Locate a coordinate at a specific distance (km), elevation angle (radians), and heading
(radians) from this one.
|
EarthVector |
findPoint(EarthVector nextCoord,
double fraction)
Locate a coordinate on the line between this one and the "next" coord, at some fraction of the
distance between them
|
EarthVector |
findPointReverseDirection(EarthVector nextCoord,
double fraction) |
static EarthVector |
fromDegrees(double lat,
double lon)
Factory methods
|
double |
getAzimuth(EarthVector loc)
Compute the azimuth (in radians) from this coord to the input coord
|
double |
getDistance(EarthVector loc)
Compute the distance (km) from this coord to the input coord using vector math (my personal
favorite)
|
double |
getDistanceReverseDirection(EarthVector loc)
Compute the distance (km) from this coord to the input coord using vector math (my personal
favorite)
|
double |
getEarthRadiusKM()
Retrieve the radius of the earth (km) at this coordinate's latitude
|
static double |
getEarthRadiusKM(double lat,
boolean flat)
Retrieve the radius of the earth (km) statically for the given latitude
|
double |
getElevation()
Get the elevation (km)
|
double |
getLatitude()
Get the latitude (radians)
|
double |
getLatitude(int units)
Get the latitude (degrees or radians)
|
double |
getLongitude()
Get the longitude (radians)
|
double |
getLongitude(int units)
Get the longitude (degrees or radians)
|
javax.vecmath.Vector3d |
getNormalizedEarthTangentVector(double azimuth) |
int |
getNumGreatCircleSegments(EarthVector endpoint,
double segmentLengthKM) |
int |
getNumGreatCircleSegments(EarthVector endpoint,
double segmentLengthKM,
boolean reverseDirection) |
javax.vecmath.Point2d |
getPoint2d() |
double |
getRadius()
Compute the radius (km) from the origin to this coord
|
double |
getSphereDistance(EarthVector loc)
Compute the distance (km) from this coord to the input coord using trigonometry.
|
javax.vecmath.Vector3d |
getUnitVector()
Normalize the ECF vector
|
javax.vecmath.Vector3d |
getVector()
Return the ECF vector
|
javax.vecmath.Vector3d |
getVector(EarthVector loc)
Compute the vector from this coord to the input coord
|
double |
getVectorDistanceKMSq(EarthVector loc) |
double |
getX()
Get the x coordinate of the ECF vector (km)
|
double |
getY()
Get the y coordinate of the ECF vector (km)
|
double |
getZ()
Get the z coordinate of the ECF vector (km)
|
int |
hashCode() |
protected void |
initVector()
Initialize the internal ECF vector from radian lat/long
|
boolean |
isOblate() |
double |
kmPerDegree()
Retrieve the number of kilometers per degree for this coord's latitude
|
static double |
kmPerDegree(double lat)
Retrieve the number of kilometers per degree at the given latitude
|
double |
kmToDegrees(double distKM) |
static double |
kmToDegrees(double distKM,
double latDeg) |
static double |
KMToNM(double km)
Convert kilometers to nautical miles
|
double |
kmToRadians(double distKM) |
static double |
kmToRadians(double distKM,
double latRad) |
static double |
KMToSM(double km)
Convert kilometers to statute miles
|
EarthVector[] |
makeGreatCircle(EarthVector endpoint)
Create a great circle from this point to an endpoint
|
EarthVector[] |
makeGreatCircleNumSegments(EarthVector endpoint,
int segments) |
EarthVector[] |
makeGreatCircleNumSegments(EarthVector endpoint,
int segments,
boolean reverseDirection) |
EarthVector[] |
makeGreatCircleSegmentLength(EarthVector endpoint,
double segmentLengthKM) |
EarthVector[] |
makeGreatCircleSegmentLengthReverseDirection(EarthVector endpoint,
double segmentLengthKM) |
EarthVector[] |
makeInterpolatedLineNumSegments(EarthVector endpoint,
int segments) |
EarthVector[] |
makeInterpolatedLineNumSegments(EarthVector endpoint,
int segments,
boolean reverseDirection) |
EarthVector[] |
makeInterpolatedLineSegmentLength(EarthVector endpoint,
double segmentLengthKM) |
EarthVector[] |
makeInterpolatedLineSegmentLength(EarthVector endpoint,
double segmentLengthKM,
boolean reverseDirection) |
static double |
NMToKM(double nm)
Convert nautical miles to kilometers
|
static double |
normalizeLatitude(double lat) |
static double |
normalizeLongitude(double lon) |
static double |
radianstoKM(double distRad,
double latRad) |
static double |
radToDeg(double rad)
Convert radians to degrees
|
javax.vecmath.Vector3d |
rotate(javax.vecmath.Vector3d rotAxis,
double angle)
Rotates this coordinate about the input vector through the input angle (radians - because we
usually use this internally)
|
void |
setCoord(EarthVector coord)
Copy the input coordinate
|
void |
setElevation(double inelev)
Set the elevation (km)
|
void |
setLatitude(double inlat)
Set the latitude (radians)
|
void |
setLatitude(double inlat,
int units)
Set the latitude (degrees or radians)
|
void |
setLongitude(double inlon)
Set the longitude (radians)
|
void |
setLongitude(double inlon,
int units)
Set the longitude (degrees or radians)
|
void |
setOblate(boolean isOblate)
Set/get oblateness
|
EarthVector |
setVector(javax.vecmath.Vector3d vec)
Copy the ECF vector
|
protected double |
sign(double x)
return the sign of the argument
|
static double |
SMToKM(double sm)
Convert statute miles to kilometers
|
String |
toString() |
static EarthVector |
translateDegrees(double lat,
double lon,
javax.vecmath.Vector3d translation) |
public static final double X_EPSILON
public static final double Y_EPSILON
public static final double ECF_EPSILON
public static final int DEGREES
public static final int RADIANS
public static final double KMperNM
public static final double KMperSM
public static final double FTperSM
public static final double SMperKM
public static final double FTperKM
public static final double INperKM
public static final double YDperKM
public static final double KMperDegree
public static final double NMperDegree
public static final double REKM
public static final double CEKM
public static final double RENM
public static final double POLAR_RENM
public static final double FLATTENING_FACTOR
public static final double EARTH_FLATTENING
public static final double FLAT_COEFF1
public static final double FLAT_COEFF2
public static final double DPR
public static final double RAD_1
public static final double RAD_45
public static final double RAD_90
public static final double RAD_180
public static final double RAD_270
public static final double RAD_360
public static final double EARTH_ROT_RATE
public static final double G
public static final double GM
public static final double J2
public static final double J3
public static final double J4
public static final double J5
public static final int SEC_90
public static final int SEC_180
public static final int SEC_270
public static final int SEC_360
protected double latitude
protected double longitude
protected double elevation
protected javax.vecmath.Vector3d ecfVector
protected boolean oblate
public EarthVector()
public EarthVector(double inlat,
double inlon)
public EarthVector(double inlat,
double inlon,
int units)
public EarthVector(double inlat,
double inlon,
double inelev)
public EarthVector(double inlat,
double inlon,
double inelev,
int units)
public EarthVector(javax.vecmath.Point2d point)
public EarthVector(javax.vecmath.Point2d point,
int units)
public EarthVector(javax.vecmath.Point2d point,
double inelev)
public EarthVector(javax.vecmath.Point2d point,
double inelev,
int units)
public EarthVector(javax.vecmath.Vector3d vec)
public EarthVector(javax.vecmath.Vector3d vec,
double inelev)
public EarthVector(EarthVector loc)
public static EarthVector fromDegrees(double lat, double lon)
public static EarthVector translateDegrees(double lat, double lon, javax.vecmath.Vector3d translation)
public void setCoord(EarthVector coord)
public boolean epsilonEquals(EarthVector otherEv, double epsilon)
public boolean equals(Object obj)
protected void initVector()
public static double normalizeLongitude(double lon)
public static double normalizeLatitude(double lat)
public void setOblate(boolean isOblate)
public boolean isOblate()
public static double degToRad(double deg)
public static double radToDeg(double rad)
public static double KMToNM(double km)
public static double KMToSM(double km)
public static double NMToKM(double nm)
public static double SMToKM(double sm)
public double getLatitude()
public double getLatitude(int units)
public double getLongitude()
public double getLongitude(int units)
public double getElevation()
public void setLatitude(double inlat)
public void setLatitude(double inlat,
int units)
public void setLongitude(double inlon)
public void setLongitude(double inlon,
int units)
public void setElevation(double inelev)
public javax.vecmath.Vector3d getVector()
public EarthVector setVector(javax.vecmath.Vector3d vec)
public double getX()
public double getY()
public double getZ()
public javax.vecmath.Vector3d getUnitVector()
public EarthVector[] makeGreatCircle(EarthVector endpoint)
public EarthVector[] makeGreatCircleSegmentLength(EarthVector endpoint, double segmentLengthKM)
public EarthVector[] makeGreatCircleSegmentLengthReverseDirection(EarthVector endpoint, double segmentLengthKM)
public EarthVector[] makeGreatCircleNumSegments(EarthVector endpoint, int segments)
public EarthVector[] makeGreatCircleNumSegments(EarthVector endpoint, int segments, boolean reverseDirection)
public EarthVector[] makeInterpolatedLineSegmentLength(EarthVector endpoint, double segmentLengthKM)
public EarthVector[] makeInterpolatedLineSegmentLength(EarthVector endpoint, double segmentLengthKM, boolean reverseDirection)
public EarthVector[] makeInterpolatedLineNumSegments(EarthVector endpoint, int segments)
public EarthVector[] makeInterpolatedLineNumSegments(EarthVector endpoint, int segments, boolean reverseDirection)
public int getNumGreatCircleSegments(EarthVector endpoint, double segmentLengthKM)
public int getNumGreatCircleSegments(EarthVector endpoint, double segmentLengthKM, boolean reverseDirection)
public EarthVector findPoint(EarthVector nextCoord, double fraction)
public EarthVector findPointReverseDirection(EarthVector nextCoord, double fraction)
public javax.vecmath.Vector3d getNormalizedEarthTangentVector(double azimuth)
public EarthVector findPoint(double distanceKM, double azimuth)
public EarthVector findPoint(double distanceKM, double azimuth, double elevAngle)
public static double kmToRadians(double distKM,
double latRad)
public static double kmToDegrees(double distKM,
double latDeg)
public static double radianstoKM(double distRad,
double latRad)
public static double degreestoKM(double distDeg,
double latDeg)
public double kmToRadians(double distKM)
public double kmToDegrees(double distKM)
public javax.vecmath.Vector3d rotate(javax.vecmath.Vector3d rotAxis,
double angle)
vecAxis - The axis of rotationang - The angle of rotation (in radians)public double getVectorDistanceKMSq(EarthVector loc)
public double getDistance(EarthVector loc)
loc - The coordinate to compute the distance topublic double getDistanceReverseDirection(EarthVector loc)
loc - The coordinate to compute the distance topublic double getSphereDistance(EarthVector loc)
loc - The coordinate to compute the distance topublic double getAzimuth(EarthVector loc)
loc - The coordinate to compute the distance topublic javax.vecmath.Vector3d getVector(EarthVector loc)
loc - public double getRadius()
public double getEarthRadiusKM()
public static double getEarthRadiusKM(double lat,
boolean flat)
public static double kmPerDegree(double lat)
public double kmPerDegree()
protected double sign(double x)
public javax.vecmath.Point2d getPoint2d()
Copyright © 2013–2019. All rights reserved.