NASA World Wind

gov.nasa.worldwind.geom
Class LatLon

java.lang.Object
  extended by gov.nasa.worldwind.geom.LatLon

public class LatLon
extends Object

Represents a point on the two-dimensional surface of a globe. Latitude is the degrees North and ranges between [-90, 90], while longitude refers to degrees East, and ranges between (-180, 180].

Instances of LatLon are immutable.


Constructor Summary
LatLon(Angle latitude, Angle longitude)
          Contructs a new LatLon from two angles.
 
Method Summary
 boolean equals(Object o)
           
static LatLon fromDegrees(double latitude, double longitude)
          Factory method for obtaining a new LatLon from two angles expressed in degrees.
static LatLon fromRadians(double latitude, double longitude)
          Factor method for obtaining a new LatLon from two angles expressed in radians.
 Angle getLatitude()
          Obtains the latitude of this LatLon.
 Angle getLongitude()
          Obtains the longitude of this LatLon.
 int hashCode()
           
static LatLon interpolate(double t, LatLon begin, LatLon end)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatLon

public LatLon(Angle latitude,
              Angle longitude)
Contructs a new LatLon from two angles. Neither angle may be null.

Parameters:
latitude -
longitude -
Throws:
IllegalArgumentException - if latitude or longitude is null
Method Detail

equals

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

fromDegrees

public static LatLon fromDegrees(double latitude,
                                 double longitude)
Factory method for obtaining a new LatLon from two angles expressed in degrees.

Parameters:
latitude - in degrees
longitude - in degrees
Returns:
a new LatLon from the given angles, which are expressed as degrees

fromRadians

public static LatLon fromRadians(double latitude,
                                 double longitude)
Factor method for obtaining a new LatLon from two angles expressed in radians.

Parameters:
latitude - in radians
longitude - in radians
Returns:
a new LatLon from the given angles, which are expressed as radians

getLatitude

public final Angle getLatitude()
Obtains the latitude of this LatLon.

Returns:
this LatLon's latitude

getLongitude

public final Angle getLongitude()
Obtains the longitude of this LatLon.

Returns:
this LatLon's longitude

hashCode

public int hashCode()
Overrides:
hashCode in class Object

interpolate

public static LatLon interpolate(double t,
                                 LatLon begin,
                                 LatLon end)

toString

public String toString()
Overrides:
toString in class Object

NASA World Wind