agi.foundation.coordinates
(agi.foundation.core-2020r3.jar)

• All Implemented Interfaces:

```public final class LongitudeLatitudeRadius
extends Object
A set of curvilinear 3-dimensional coordinates typically used to describe geocentric (or planetocentric on non-Earth central bodies) positions. Longitude is an angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. Latitude is an angle measured from the xy-plane and toward the positive z-axis. Radius is a linear coordinate measured from the origin.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static Motion1<LongitudeLatitudeRadius>` ```convertMotion(Motion1<Cartesian> motion, int order)```
Converts the motion given in terms of a set of `Cartesian` coordinates to motion of the corresponding set of `LongitudeLatitudeRadius` coordinates.
`static boolean` ```equals(LongitudeLatitudeRadius left, LongitudeLatitudeRadius right)```
Returns `true` if the two instances are exactly equal.
`boolean` `equals(Object obj)`
Indicates whether another object is exactly equal to this instance.
`boolean` ```equalsEpsilon(LongitudeLatitudeRadius other, double epsilon)```
Indicates whether each coordinate value of another instance of this type is within the required tolerance of the corresponding coordinate value of this instance.
`boolean` `equalsType(LongitudeLatitudeRadius other)`
Indicates whether another instance of this type is exactly equal to this instance.
`double` `get(int index)`
Gets the value of the specified element with `index` of 0, 1, and 2 corresponding to the coordinates `Longitude` (`get`), `Latitude` (`get`), and `Radius` (`get`).
`double` `getLatitude()`
Gets the angular coordinate measured from the xy-plane and toward the positive z-axis.
`int` `getLength()`
Gets the number of elements in this set of coordinates.
`double` `getLongitude()`
Gets the angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
`double` `getRadius()`
Gets the linear coordinate measured from the origin.
`static LongitudeLatitudeRadius` `getZero()`
Gets a set of `LongitudeLatitudeRadius` coordinates with values of zero.
`int` `hashCode()`
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
`static boolean` ```notEquals(LongitudeLatitudeRadius left, LongitudeLatitudeRadius right)```
Returns `true` if the two instances are not exactly equal.
`String` `toString()`
Returns the string representation of the value of this instance.
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

`public LongitudeLatitudeRadius()`
Initializes a new instance.

```public LongitudeLatitudeRadius(double longitude,
double latitude,
Initializes a set of `LongitudeLatitudeRadius` coordinates from the provided longitude, latitude, and radius.
Parameters:
`longitude` - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
`latitude` - The angular coordinate measured from the xy-plane and toward the positive z-axis.
`radius` - The linear coordinate measured from the origin.

```public LongitudeLatitudeRadius(@Nonnull
Cartesian coordinates)```
Initializes a set of `LongitudeLatitudeRadius` coordinates from the provided set of `Cartesian` coordinates.
Parameters:
`coordinates` - The set of Cartesian coordinates.

```public LongitudeLatitudeRadius(@Nonnull
double[] elements)```
Initializes a set of `LongitudeLatitudeRadius` coordinates from the first 3 consecutive elements in the provided array.
Parameters:
`elements` - The array of coordinate values. The first value is treated as the `Longitude` (`get`), the second as the `Latitude` (`get`), and the third as the `Radius` (`get`).
Throws:
`ArgumentNullException` - Thrown when `elements` is `null`.
`ArgumentOutOfRangeException` - An object of this type must be constructed from an array with at least 3 `elements`.

```public LongitudeLatitudeRadius(@Nonnull
double[] elements,
int startIndex)```
Initializes a set of `LongitudeLatitudeRadius` coordinates from the provided array.
Parameters:
`elements` - The array of coordinate values. The first value is treated as the `Longitude` (`get`), the second as the `Latitude` (`get`), and the third as the `Radius` (`get`).
`startIndex` - The index of the first element in the array to use.
Throws:
`ArgumentNullException` - Thrown when `elements` is `null`.
`ArgumentOutOfRangeException` - Thrown when an object of this type is constructed from an array with less than 3 `elements`.
• ### Method Detail

• #### getZero

```@Nonnull
Gets a set of `LongitudeLatitudeRadius` coordinates with values of zero.
• #### convertMotion

```@Nonnull
Motion1<Cartesian> motion,
int order)```
Converts the motion given in terms of a set of `Cartesian` coordinates to motion of the corresponding set of `LongitudeLatitudeRadius` coordinates.
Parameters:
`motion` - The Cartesian motion.
`order` - The order of the highest derivative to convert.
Returns:
The motion of the `LongitudeLatitudeRadius`.
• #### getLongitude

`public final double getLongitude()`
Gets the angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
• #### getLatitude

`public final double getLatitude()`
Gets the angular coordinate measured from the xy-plane and toward the positive z-axis.

`public final double getRadius()`
Gets the linear coordinate measured from the origin.
• #### getLength

`public final int getLength()`
Gets the number of elements in this set of coordinates.
• #### get

`public final double get(int index)`
Gets the value of the specified element with `index` of 0, 1, and 2 corresponding to the coordinates `Longitude` (`get`), `Latitude` (`get`), and `Radius` (`get`).
Parameters:
`index` - The index to retrieve.
Returns:
The coordinate associated with the specified `index`.
Throws:
`ArgumentOutOfRangeException` - Thrown when `index` is less than 0 or greater than or equal to `Length` (`get`).
• #### equals

`public boolean equals(Object obj)`
Indicates whether another object is exactly equal to this instance.
Overrides:
`equals` in class `Object`
Parameters:
`obj` - The object to compare to this instance.
Returns:
`true` if `obj` is an instance of this type and represents the same value as this instance; otherwise `false`.
`Object.hashCode()`, `HashMap`
• #### equalsType

```public final boolean equalsType(@Nonnull
Indicates whether another instance of this type is exactly equal to this instance.
Specified by:
`equalsType` in interface `IEquatable<LongitudeLatitudeRadius>`
Parameters:
`other` - The instance to compare to this instance.
Returns:
`true` if `other` represents the same value as this instance; otherwise `false`.
• #### equalsEpsilon

```public final boolean equalsEpsilon(@Nonnull
double epsilon)```
Indicates whether each coordinate value of another instance of this type is within the required tolerance of the corresponding coordinate value of this instance.
Parameters:
`other` - The set of `LongitudeLatitudeRadius` coordinates to compare to this instance.
`epsilon` - The limit at which the absolute differences between the coordinate values will not be considered equal.
Returns:
`true` if the absolute differences are less than or equal to `epsilon`; otherwise `false`.
• #### toString

`public String toString()`
Returns the string representation of the value of this instance.
Overrides:
`toString` in class `Object`
Returns:
A string that represents the value of this instance in the form Longitude, Latitude, and Radius.
• #### equals

```public static boolean equals(@Nonnull
@Nonnull
Returns `true` if the two instances are exactly equal.
Parameters:
`left` - The instance to compare to `right`.
`right` - The instance to compare to `left`.
Returns:
`true` if `left` represents the same value as `right`; otherwise `false`.
• #### notEquals

```public static boolean notEquals(@Nonnull
Returns `true` if the two instances are not exactly equal.
`left` - The instance to compare to `right`.
`right` - The instance to compare to `left`.
`true` if `left` does not represent the same value as `right`; otherwise `false`.