Package gov.nasa.worldwind.geom
Class Position
- java.lang.Object
-
- gov.nasa.worldwind.geom.LatLon
-
- gov.nasa.worldwind.geom.Position
-
- Direct Known Subclasses:
SARPosition
public class Position extends LatLon
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Position.PositionList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
add(Position that)
static java.util.List<Position>
computeShiftedPositions(Position oldPosition, Position newPosition, java.lang.Iterable<? extends Position> positions)
Computes a new set of positions translated from a specified reference position to a new reference position.static java.util.List<Position>
computeShiftedPositions(Globe globe, Position oldPosition, Position newPosition, java.lang.Iterable<? extends Position> positions)
boolean
equals(java.lang.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 positiondouble
getElevation()
Obtains the elevation of this positionint
hashCode()
static Position
interpolate(double amount, Position value1, Position value2)
Returns the linear interpolation ofvalue1
andvalue2
, 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 betweenvalue1
andvalue2
.static Position
interpolateRhumb(double amount, Position value1, Position value2)
Returns the an interpolated location along the rhumb line betweenvalue1
andvalue2
.static boolean
positionsCrossDateLine(java.lang.Iterable<? extends Position> positions)
Position
subtract(Position that)
java.lang.String
toString()
-
Methods inherited from class gov.nasa.worldwind.geom.LatLon
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
-
-
-
-
Field Detail
-
ZERO
public static final Position ZERO
-
elevation
public final double elevation
-
-
Method Detail
-
fromRadians
public static Position fromRadians(double latitude, double longitude, double elevation)
-
fromDegrees
public static Position fromDegrees(double latitude, double longitude, double elevation)
-
fromDegrees
public static Position fromDegrees(double latitude, double longitude)
-
getElevation
public double getElevation()
Obtains the elevation of this position- Returns:
- this position's elevation
-
getAltitude
public double getAltitude()
Obtains the elevation of this position- Returns:
- this position's elevation
-
interpolate
public static Position interpolate(double amount, Position value1, Position value2)
Returns the linear interpolation ofvalue1
andvalue2
, treating the geographic locations as simple 2D coordinate pairs, and treating the elevation values as 1D scalars.- Parameters:
amount
- the interpolation factorvalue1
- the first position.value2
- the second position.- Returns:
- the linear interpolation of
value1
andvalue2
. - Throws:
java.lang.IllegalArgumentException
- if either position is null.
-
interpolateGreatCircle
public static Position interpolateGreatCircle(double amount, Position value1, Position value2)
Returns the an interpolated location along the great-arc betweenvalue1
andvalue2
. The position's elevation components are linearly interpolated as a simple 1D scalar value. The interpolation factoramount
defines the weight given to each value, and is clamped to the range [0, 1]. Ifa
is 0 or less, this returnsvalue1
. Ifamount
is 1 or more, this returnsvalue2
. Otherwise, this returns the position on the great-arc betweenvalue1
andvalue2
with a linearly interpolated elevation component, and corresponding to the specified interpolation factor.- Parameters:
amount
- the interpolation factorvalue1
- the first position.value2
- the second position.- Returns:
- an interpolated position along the great-arc between
value1
andvalue2
, with a linearly interpolated elevation component. - Throws:
java.lang.IllegalArgumentException
- if either location is null.
-
interpolateRhumb
public static Position interpolateRhumb(double amount, Position value1, Position value2)
Returns the an interpolated location along the rhumb line betweenvalue1
andvalue2
. The position's elevation components are linearly interpolated as a simple 1D scalar value. The interpolation factoramount
defines the weight given to each value, and is clamped to the range [0, 1]. Ifa
is 0 or less, this returnsvalue1
. Ifamount
is 1 or more, this returnsvalue2
. Otherwise, this returns the position on the rhumb line betweenvalue1
andvalue2
with a linearly interpolated elevation component, and corresponding to the specified interpolation factor.- Parameters:
amount
- the interpolation factorvalue1
- the first position.value2
- the second position.- Returns:
- an interpolated position along the great-arc between
value1
andvalue2
, with a linearly interpolated elevation component. - Throws:
java.lang.IllegalArgumentException
- if either location is null.
-
positionsCrossDateLine
public static boolean positionsCrossDateLine(java.lang.Iterable<? extends Position> positions)
-
computeShiftedPositions
public static java.util.List<Position> computeShiftedPositions(Position oldPosition, Position newPosition, java.lang.Iterable<? extends Position> positions)
Computes a new set of positions translated from a specified reference position to a new reference position.- Parameters:
oldPosition
- the original reference position.newPosition
- the new reference position.positions
- the positions to translate.- Returns:
- the translated positions, or null if the positions could not be translated.
- Throws:
java.lang.IllegalArgumentException
- if any argument is null.
-
computeShiftedPositions
public static java.util.List<Position> computeShiftedPositions(Globe globe, Position oldPosition, Position newPosition, java.lang.Iterable<? extends Position> positions)
-
-