public class PolarPoint
extends java.lang.Object
PolarPoint
are immutable.Modifier and Type | Field and Description |
---|---|
static PolarPoint |
ZERO |
Constructor and Description |
---|
PolarPoint(Angle latitude,
Angle longitude,
double radius)
Obtains a
PolarPoint from two angles and a radius. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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.
|
java.lang.String |
toString() |
public static final PolarPoint ZERO
public PolarPoint(Angle latitude, Angle longitude, double radius)
PolarPoint
from two angles
and a radius.latitude
- the latitudelongitude
- the longituderadius
- the distance from the centerjava.lang.IllegalArgumentException
- if latitude
or longitude
is nullpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static PolarPoint fromCartesian(double x, double y, double z)
PolarPoint
from cartesian coordinates.x
- the x coordinate of the cartesian pointy
- the y coordinate of the cartesian pointz
- the z coordinate of the cartesian pointpublic static PolarPoint fromCartesian(Vec4 cartesianPoint)
PolarPoint
from a cartesian point.cartesianPoint
- the point to convertjava.lang.IllegalArgumentException
- if cartesianPoint
is nullpublic static PolarPoint fromDegrees(double latitude, double longitude, double radius)
PolarPoint
from degrees and a radius.latitude
- the latitude in degreeslongitude
- the longitude in degreesradius
- the distance form the centerPolarPoint
public static PolarPoint fromRadians(double latitude, double longitude, double radius)
PolarPoint
from radians and a radius.latitude
- the latitude in radianslongitude
- the longitude in radiansradius
- the distance form the centerPolarPoint
public final Angle getLatitude()
public final Angle getLongitude()
public final double getRadius()
public int hashCode()
hashCode
in class java.lang.Object
public final Vec4 toCartesian()
PolarPoint
, except in cartesian space.public static Vec4 toCartesian(Angle latitude, Angle longitude, double radius)
Vec4 p = new PolarPoint(latitude, longitude, radius).toCartesian()
latitude
- the latitudelongitude
- the longituderadius
- the distance from the originjava.lang.IllegalArgumentException
- if latitude
or longitude
is nullpublic java.lang.String toString()
toString
in class java.lang.Object