NASA World Wind

gov.nasa.worldwind.geom
Class Position

java.lang.Object
  extended by gov.nasa.worldwind.geom.LatLon
      extended by gov.nasa.worldwind.geom.Position
Direct Known Subclasses:
SARPosition

public class Position
extends LatLon


Nested Class Summary
static class Position.PositionList
           
 
Field Summary
 double elevation
           
static Position ZERO
           
 
Fields inherited from class gov.nasa.worldwind.geom.LatLon
latitude, longitude
 
Constructor Summary
Position(Angle latitude, Angle longitude, double elevation)
           
Position(LatLon latLon, double elevation)
           
 
Method Summary
 Position add(Position that)
           
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()
           
 
Methods inherited from class gov.nasa.worldwind.geom.LatLon
add, asDegreesArray, asRadiansArray, computeShiftedLocations, ellipsoidalDistance, ellipsoidalForwardAzimuth, equals, fromRadians, getAverageDistance, getLatitude, getLongitude, greatCircleArcExtremeLocations, greatCircleArcExtremeLocations, greatCircleAzimuth, greatCircleDistance, greatCircleEndPosition, greatCircleEndPosition, greatCircleExtremeLocations, interpolate, interpolate, interpolateGreatCircle, interpolateRhumb, linearAzimuth, linearDistance, linearEndPosition, locationsCrossDateLine, locationsCrossDateline, makeDatelineCrossingLocationsPositive, parseLatLon, rhumbAzimuth, rhumbDistance, rhumbEndPosition, rhumbEndPosition, subtract
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

elevation

public final double elevation

ZERO

public static final Position ZERO
Constructor Detail

Position

public Position(Angle latitude,
                Angle longitude,
                double elevation)

Position

public Position(LatLon latLon,
                double elevation)
Method Detail

add

public Position add(Position that)
Overrides:
add in class LatLon

computeShiftedPositions

public 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.

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:
IllegalArgumentException - if any argument is null.

equals

public boolean equals(Object o)
Overrides:
equals in class LatLon

fromDegrees

public static Position fromDegrees(double latitude,
                                   double longitude)

fromDegrees

public static Position fromDegrees(double latitude,
                                   double longitude,
                                   double elevation)

fromRadians

public static Position fromRadians(double latitude,
                                   double longitude,
                                   double elevation)

getAltitude

public double getAltitude()
Obtains the elevation of this position

Returns:
this position's elevation

getElevation

public double getElevation()
Obtains the elevation of this position

Returns:
this position's elevation

hashCode

public int hashCode()
Overrides:
hashCode in class LatLon

interpolate

public 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.

Parameters:
amount - the interpolation factor
value1 - the first position.
value2 - the second position.
Returns:
the linear interpolation of value1 and value2.
Throws:
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 between 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.

Parameters:
amount - the interpolation factor
value1 - the first position.
value2 - the second position.
Returns:
an interpolated position along the great-arc between value1 and value2, with a linearly interpolated elevation component.
Throws:
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 between 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.

Parameters:
amount - the interpolation factor
value1 - the first position.
value2 - the second position.
Returns:
an interpolated position along the great-arc between value1 and value2, with a linearly interpolated elevation component.
Throws:
IllegalArgumentException - if either location is null.

positionsCrossDateLine

public static boolean positionsCrossDateLine(Iterable<? extends Position> positions)

subtract

public Position subtract(Position that)
Overrides:
subtract in class LatLon

toString

public String toString()
Overrides:
toString in class LatLon

NASA World Wind