Jeospace API

org.jeospace.coordinate
Class Polar

java.lang.Object
  extended byorg.jeospace.coordinate.Polar
Direct Known Subclasses:
Ellipsoidal, Spherical

public abstract class Polar
extends java.lang.Object

An abstract base class for representing forms of 3 dimensional spherical polar coordinates. Polar provides interfaces for transforming to and from Cartesian coordinate representations and a base implementation for Spherical and Ellipsoidal coordinates.

For further reference see: http://mathworld.wolfram.com/SphericalCoordinates.html

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton
See Also:
Longitude, Latitude, Length, Cartesian, Spherical, Ellipsoidal

Field Summary
 Length distance
          The distance component of the Polar coordinate
 Latitude latitude
          The latitude component of the Polar coordinate
 Longitude longitude
          The longitude component of the Polar coordinate
 
Constructor Summary
Polar()
          Create a Polar coordinate object with default parameters.
 
Method Summary
 void clear()
          Clear the Polar coordinate components.
 Angle getAngularSeparation(Polar target)
          Return the angular separation between this Polar object and the argument.
abstract  Cartesian getCartesian()
          Get the Cartesian representation of the Polar coordinate.
abstract  void getCartesian(Cartesian cartesian)
          Get the Cartesian representation of the Polar coordinate.
abstract  Cartesian getCartesian(Length scale)
          Get the Cartesian representation of the Polar coordinate.
abstract  void set(Cartesian cartesian)
          Set the Polar coordinate object's components.
 void set(double longitudeDegrees, double latitudeDegrees, Length radius)
          Set the Polar coordinate object's components.
 void set(Longitude longitude, Latitude latitude, Length radius)
          Set the Polar coordinate object's components.
 void set(Polar polar)
          Set the Polar coordinate object's components.
 void setToAntipode()
          Set the Polar coordinate to it's antipode.
 java.lang.String toString()
          Return a string representation of this polar coordinate of the form "longitude, latitude, distance".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

longitude

public final Longitude longitude
The longitude component of the Polar coordinate


latitude

public final Latitude latitude
The latitude component of the Polar coordinate


distance

public final Length distance
The distance component of the Polar coordinate

Constructor Detail

Polar

public Polar()
Create a Polar coordinate object with default parameters.
longitude = 0 degrees
latitude = 0 degrees
distance = 0 meters

Method Detail

set

public abstract void set(Cartesian cartesian)
Set the Polar coordinate object's components.

Parameters:
cartesian - the Cartesian coordinate to convert to a Polar representation.

set

public void set(Longitude longitude,
                Latitude latitude,
                Length radius)
Set the Polar coordinate object's components.

Parameters:
longitude - the Longitude component initializer
latitude - the Latitude component initializer
radius - the Length component initializer

set

public void set(double longitudeDegrees,
                double latitudeDegrees,
                Length radius)
Set the Polar coordinate object's components.

Parameters:
longitudeDegrees - the double value initializer for the Longitude component
latitudeDegrees - the double value initializer for the Latitude component
radius - the Length component initializer

set

public void set(Polar polar)
Set the Polar coordinate object's components.

Parameters:
polar - the Polar coordinate object to duplicate

getCartesian

public abstract Cartesian getCartesian()
Get the Cartesian representation of the Polar coordinate.

Returns:
the cartesian representation of this polar coordinate

getCartesian

public abstract Cartesian getCartesian(Length scale)
Get the Cartesian representation of the Polar coordinate.

Parameters:
scale - the Length object scale factor.
Returns:
the cartesian representation of this spherical coordinate

getCartesian

public abstract void getCartesian(Cartesian cartesian)
Get the Cartesian representation of the Polar coordinate.

Parameters:
cartesian - the Cartesian object to initialize.

getAngularSeparation

public Angle getAngularSeparation(Polar target)
Return the angular separation between this Polar object and the argument. The return value will always be 0 <= value <= Math.PI.

Parameters:
target - the argument Polar object
Returns:
the angular separation

setToAntipode

public void setToAntipode()
Set the Polar coordinate to it's antipode.


clear

public void clear()
Clear the Polar coordinate components.


toString

public java.lang.String toString()
Return a string representation of this polar coordinate of the form "longitude, latitude, distance".

Returns:
a string representation of this polar coordinate

Jeospace API

Copyright © 2006 - jeospace.org