Class Position

    • Field Detail

      • ZERO

        public static final Position ZERO
      • elevation

        public final double elevation
    • Constructor Detail

      • Position

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

        public Position​(LatLon latLon,
                        double elevation)
      • Position

        public Position​(Position that)
    • 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 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:
        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 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:
        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 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:
        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)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class LatLon
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class LatLon
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class LatLon