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 classPosition.PositionList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Positionadd(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)booleanequals(java.lang.Object o)static PositionfromDegrees(double latitude, double longitude)static PositionfromDegrees(double latitude, double longitude, double elevation)static PositionfromRadians(double latitude, double longitude, double elevation)doublegetAltitude()Obtains the elevation of this positiondoublegetElevation()Obtains the elevation of this positioninthashCode()static Positioninterpolate(double amount, Position value1, Position value2)Returns the linear interpolation ofvalue1andvalue2, treating the geographic locations as simple 2D coordinate pairs, and treating the elevation values as 1D scalars.static PositioninterpolateGreatCircle(double amount, Position value1, Position value2)Returns the an interpolated location along the great-arc betweenvalue1andvalue2.static PositioninterpolateRhumb(double amount, Position value1, Position value2)Returns the an interpolated location along the rhumb line betweenvalue1andvalue2.static booleanpositionsCrossDateLine(java.lang.Iterable<? extends Position> positions)Positionsubtract(Position that)java.lang.StringtoString()-
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 ofvalue1andvalue2, 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
value1andvalue2. - 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 betweenvalue1andvalue2. The position's elevation components are linearly interpolated as a simple 1D scalar value. The interpolation factoramountdefines the weight given to each value, and is clamped to the range [0, 1]. Ifais 0 or less, this returnsvalue1. Ifamountis 1 or more, this returnsvalue2. Otherwise, this returns the position on the great-arc betweenvalue1andvalue2with 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
value1andvalue2, 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 betweenvalue1andvalue2. The position's elevation components are linearly interpolated as a simple 1D scalar value. The interpolation factoramountdefines the weight given to each value, and is clamped to the range [0, 1]. Ifais 0 or less, this returnsvalue1. Ifamountis 1 or more, this returnsvalue2. Otherwise, this returns the position on the rhumb line betweenvalue1andvalue2with 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
value1andvalue2, 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)
-
-