NASA World Wind
gov.nasa.worldwind.geom

## Class PolarPoint

• ```public class PolarPoint
extends Object```
Represents a point in space defined by a latitude, longitude and distance from the origin.

Instances of `PolarPoint` are immutable.

• ### Field Summary

Fields
Modifier and Type Field and Description
`static PolarPoint` `ZERO`
• ### Constructor Summary

Constructors
Constructor and Description
```PolarPoint(Angle latitude, Angle longitude, double radius)```
Obtains a `PolarPoint` from two `angles` and a radius.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`boolean` `equals(Object o)`
`static PolarPoint` ```fromCartesian(double x, double y, double z)```
Obtains a `PolarPoint` from cartesian coordinates.
`static PolarPoint` `fromCartesian(Vec4 cartesianPoint)`
Obtains a `PolarPoint` from a cartesian point.
`static PolarPoint` ```fromDegrees(double latitude, double longitude, double radius)```
Obtains a `PolarPoint` from degrees and a radius.
`static PolarPoint` ```fromRadians(double latitude, double longitude, double radius)```
Obtains a `PolarPoint` from radians and a radius.
`Angle` `getLatitude()`
Obtains the latitude of this polar point
`Angle` `getLongitude()`
Obtains the longitude of this polar point
`double` `getRadius()`
Obtains the radius of this polar point
`int` `hashCode()`
`Vec4` `toCartesian()`
Obtains a cartesian point equivalent to this `PolarPoint`, except in cartesian space.
`static Vec4` ```toCartesian(Angle latitude, Angle longitude, double radius)```
Obtains a cartesian point from a given latitude, longitude and distance from center.
`String` `toString()`
• ### Methods inherited from class java.lang.Object

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

• #### ZERO

`public static final PolarPoint ZERO`
• ### Constructor Detail

• #### PolarPoint

```public PolarPoint(Angle latitude,
Angle longitude,
Obtains a `PolarPoint` from two `angles` and a radius.
Parameters:
`latitude` - the latitude
`longitude` - the longitude
`radius` - the distance from the center
Throws:
`IllegalArgumentException` - if `latitude` or `longitude` is null
• ### Method Detail

• #### equals

`public boolean equals(Object o)`
Overrides:
`equals` in class `Object`
• #### fromCartesian

```public static PolarPoint fromCartesian(double x,
double y,
double z)```
Obtains a `PolarPoint` from cartesian coordinates.
Parameters:
`x` - the x coordinate of the cartesian point
`y` - the y coordinate of the cartesian point
`z` - the z coordinate of the cartesian point
Returns:
a polar point located at (x,y,z) in cartesian space
• #### fromCartesian

`public static PolarPoint fromCartesian(Vec4 cartesianPoint)`
Obtains a `PolarPoint` from a cartesian point.
Parameters:
`cartesianPoint` - the point to convert
Returns:
the cartesian point expressed as a polar point
Throws:
`IllegalArgumentException` - if `cartesianPoint` is null
• #### fromDegrees

```public static PolarPoint fromDegrees(double latitude,
double longitude,
Obtains a `PolarPoint` from degrees and a radius.
Parameters:
`latitude` - the latitude in degrees
`longitude` - the longitude in degrees
`radius` - the distance form the center
Returns:
a new `PolarPoint`

```public static PolarPoint fromRadians(double latitude,
double longitude,
Obtains a `PolarPoint` from radians and a radius.
Parameters:
`latitude` - the latitude in radians
`longitude` - the longitude in radians
`radius` - the distance form the center
Returns:
a new `PolarPoint`
• #### getLatitude

`public final Angle getLatitude()`
Obtains the latitude of this polar point
Returns:
this polar point's latitude
• #### getLongitude

`public final Angle getLongitude()`
Obtains the longitude of this polar point
Returns:
this polar point's longitude

`public final double getRadius()`
Obtains the radius of this polar point
Returns:
the distance from this polar point to its origin
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Object`
• #### toCartesian

`public final Vec4 toCartesian()`
Obtains a cartesian point equivalent to this `PolarPoint`, except in cartesian space.
Returns:
this polar point in cartesian coordinates
• #### toCartesian

```public static Vec4 toCartesian(Angle latitude,
Angle longitude,
Obtains a cartesian point from a given latitude, longitude and distance from center. This method is equivalent to, but may perform faster than `Vec4 p = new PolarPoint(latitude, longitude, radius).toCartesian()`
Parameters:
`latitude` - the latitude
`longitude` - the longitude
`radius` - the distance from the origin
Returns:
a cartesian point from two angles and a radius
Throws:
`IllegalArgumentException` - if `latitude` or `longitude` is null
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`