public class Position extends LatLon
Modifier and Type | Class and Description |
---|---|
static class |
Position.PositionList |
Modifier and Type | Field and Description |
---|---|
double |
elevation |
static Position |
ZERO |
latitude, longitude, NEAR_ZERO_THRESHOLD
Constructor and Description |
---|
Position(Angle latitude,
Angle longitude,
double elevation) |
Position(LatLon latLon,
double elevation) |
Modifier and Type | Method and Description |
---|---|
Position |
add(Position that) |
static List<Position> |
computeShiftedPositions(Globe globe,
Position oldPosition,
Position newPosition,
Iterable<? extends Position> positions) |
static List<Position> |
computeShiftedPositions(Position oldPosition,
Position newPosition,
Iterable<? extends Position> positions)
Computes a new set of positions translated from a specified reference position to a new reference position.
|
boolean |
equals(Object o) |
static Position |
fromDegrees(double latitude,
double longitude) |
static Position |
fromDegrees(double latitude,
double longitude,
double elevation) |
static Position |
fromRadians(double latitude,
double longitude,
double elevation) |
double |
getAltitude()
Obtains the elevation of this position
|
double |
getElevation()
Obtains the elevation of this position
|
int |
hashCode() |
static Position |
interpolate(double amount,
Position value1,
Position value2)
Returns the linear interpolation of
value1 and value2 , treating the geographic
locations as simple 2D coordinate pairs, and treating the elevation values as 1D scalars. |
static Position |
interpolateGreatCircle(double amount,
Position value1,
Position value2)
Returns the an interpolated location along the great-arc between
value1 and value2 . |
static Position |
interpolateRhumb(double amount,
Position value1,
Position value2)
Returns the an interpolated location along the rhumb line between
value1 and value2 . |
static boolean |
positionsCrossDateLine(Iterable<? extends Position> positions) |
Position |
subtract(Position that) |
String |
toString() |
add, asDegreesArray, asRadiansArray, computeShiftedLocations, computeShiftedLocations, cutLocationsAlongDateLine, ellipsoidalDistance, ellipsoidalForwardAzimuth, equals, fromRadians, getAverageDistance, getAverageDistance, getCenter, getCenter, getLatitude, getLongitude, greatCircleArcExtremeLocations, greatCircleArcExtremeLocations, greatCircleAzimuth, greatCircleDistance, greatCircleEndPosition, greatCircleEndPosition, greatCircleExtremeLocations, interpolate, interpolate, interpolateGreatCircle, interpolateRhumb, intersectionWithMeridian, intersectionWithMeridian, linearAzimuth, linearDistance, linearEndPosition, locationsContainPole, locationsCrossDateLine, locationsCrossDateline, makeDatelineCrossingLocationsPositive, parseLatLon, pathDistance, repeatLocationsAroundDateline, rhumbAzimuth, rhumbDistance, rhumbEndPosition, rhumbEndPosition, subtract
public final double elevation
public static final Position ZERO
public Position(LatLon latLon, double elevation)
public static List<Position> computeShiftedPositions(Globe globe, Position oldPosition, Position newPosition, Iterable<? extends Position> positions)
public static List<Position> computeShiftedPositions(Position oldPosition, Position newPosition, Iterable<? extends Position> positions)
oldPosition
- the original reference position.newPosition
- the new reference position.positions
- the positions to translate.IllegalArgumentException
- if any argument is null.public static Position fromDegrees(double latitude, double longitude)
public static Position fromDegrees(double latitude, double longitude, double elevation)
public static Position fromRadians(double latitude, double longitude, double elevation)
public double getAltitude()
public double getElevation()
public static Position interpolate(double amount, Position value1, Position value2)
value1
and value2
, treating the geographic
locations as simple 2D coordinate pairs, and treating the elevation values as 1D scalars.amount
- the interpolation factorvalue1
- the first position.value2
- the second position.value1
and value2
.IllegalArgumentException
- if either position is null.public static Position interpolateGreatCircle(double amount, Position value1, Position value2)
value1
and value2
. The
position's elevation components are linearly interpolated as a simple 1D scalar value. The interpolation factor
amount
defines the weight given to each value, and is clamped to the range [0, 1]. If a
is 0 or less, this returns value1
. If amount
is 1 or more, this returns
value2
. Otherwise, this returns the position on the great-arc between value1
and
value2
with a linearly interpolated elevation component, and corresponding to the specified
interpolation factor.amount
- the interpolation factorvalue1
- the first position.value2
- the second position.value1
and value2
, with a
linearly interpolated elevation component.IllegalArgumentException
- if either location is null.public static Position interpolateRhumb(double amount, Position value1, Position value2)
value1
and value2
.
The position's elevation components are linearly interpolated as a simple 1D scalar value. The interpolation
factor amount
defines the weight given to each value, and is clamped to the range [0, 1]. If
a
is 0 or less, this returns value1
. If amount
is 1 or more, this returns
value2
. Otherwise, this returns the position on the rhumb line between value1
and
value2
with a linearly interpolated elevation component, and corresponding to the specified
interpolation factor.amount
- the interpolation factorvalue1
- the first position.value2
- the second position.value1
and value2
, with a
linearly interpolated elevation component.IllegalArgumentException
- if either location is null.public static boolean positionsCrossDateLine(Iterable<? extends Position> positions)