Jeospace API

org.jeospace.measure.angle
Class Latitude

java.lang.Object
  extended byorg.jeospace.measure.angle.DecimalAngle
      extended byorg.jeospace.measure.angle.Latitude
All Implemented Interfaces:
Angle, java.lang.Cloneable, java.lang.Comparable

public class Latitude
extends DecimalAngle
implements java.lang.Cloneable

A subclass of DecimalAngle, a latitude is an angle that is restricted in value to be within a half revolution of arc. A latitude is typically used as a component of a spherical coordinate system.

By convention, latitude directions are measured:

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton
See Also:
Angle, DecimalAngle, DecimalAngleUnit, Longitude, SexagesimalAngleType, SexagesimalAngleUnit

Field Summary
static AngleSign NORTH
          Constant identifier indicating a positive direction of the Latitude.
static AngleSign SOUTH
          Constant identifier indicating a negative direction of the Latitude.
 
Fields inherited from class org.jeospace.measure.angle.DecimalAngle
angle
 
Constructor Summary
Latitude()
          Construct a Latitude initialized to a value of 0.
Latitude(Angle ang)
          Construct a Latitude initialized to the specified value.
Latitude(DecimalAngleUnit units, double value)
          Construct a Latitude initialized to the value and units specified.
Latitude(SexagesimalAngleType type, AngleSign sign, double unitsValue)
          Construct a Latitude initialized to the value and units specified.
Latitude(SexagesimalAngleType type, AngleSign sign, int unitsValue, double minutes)
          Construct a Latitude initialized to the value and units specified.
Latitude(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, double seconds)
          Construct a Latitude initialized to the value and units specified.
Latitude(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, int seconds, int microseconds)
          Construct a Latitude initialized to the value and units specified.
 
Method Summary
 void add(Angle ang)
          Add to this Latitude the passed Angle.
 void add(DecimalAngleUnit units, double value)
          Add to this Latitude the double value in the specified DecimalAngleUnits.
 void add(SexagesimalAngleUnit units, int value)
          Add to this Latitude the value in the specified SexagesimalAngleUnits.
 boolean addCheckRollover(Angle ang)
          Add to this Latitude object the passed Angle object.
 boolean addCheckRollover(DecimalAngleUnit units, double value)
          Add to this Latitude the double value in the specified DecimalAngleUnits.
 boolean addCheckRollover(SexagesimalAngleUnit units, int value)
          Add to this Latitude the value in the specified SexagesimalAngleUnits.
 java.lang.Object clone()
          Return a copy of this Latitude object.
 boolean equals(java.lang.Object obj)
          Compare two Latitudes for equality.
 void normalize(AngleNorm option)
          Overriding DecimalAngle, this method does nothing.
protected  boolean normalizeCheckRollover()
          Normalize the value of this Latitude object to a value that is +/- 90 degrees ( Math.PI/2 radians ) or less.
 void set(Angle ang)
          Set this Latitude to the specified value.
 void set(DecimalAngleUnit units, double value)
          Set the value of this Latitude to the specified DecimalAngleUnits value.
 void set(SexagesimalAngleType type, AngleSign sign, double unitsValue)
          Set this Latitude to the specified value in the SexagesimalAngleType.
 void set(SexagesimalAngleType type, AngleSign sign, int unitsValue, double minutes)
          Set this Latitude to the specified value in the SexagesimalAngleType.
 void set(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, double seconds)
          Set this Latitude to the specified value in the SexagesimalAngleType.
 void set(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, int seconds, int microseconds)
          Set this Latitude to the specified value in the SexagesimalAngleType.
 void setValueInMicroseconds(SexagesimalAngleType type, long value)
          Set this Latitude to the specified value of microseconds of the SexagesimalAngleType.
 void subtract(Angle ang)
          Subtract from this Latitude the passed Angle.
 
Methods inherited from class org.jeospace.measure.angle.DecimalAngle
changeSign, clear, compareTo, compareTo, get, getSign, getValueInMicroseconds, hashCode, normalizeDegrees, normalizeDegreesNegative, normalizeDegreesPositive, normalizeRadians, normalizeRadiansNegative, normalizeRadiansPositive, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NORTH

public static final AngleSign NORTH
Constant identifier indicating a positive direction of the Latitude.


SOUTH

public static final AngleSign SOUTH
Constant identifier indicating a negative direction of the Latitude.

Constructor Detail

Latitude

public Latitude()
Construct a Latitude initialized to a value of 0.


Latitude

public Latitude(Angle ang)
Construct a Latitude initialized to the specified value.

Parameters:
ang - the Angle object to duplicate.

Latitude

public Latitude(DecimalAngleUnit units,
                double value)
Construct a Latitude initialized to the value and units specified.

Parameters:
units - the DecimalAngleUnits of value being input.
value - the input value

Latitude

public Latitude(SexagesimalAngleType type,
                AngleSign sign,
                double unitsValue)
Construct a Latitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the double value of the primary units of the SexagesimalAngleType.

Latitude

public Latitude(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                double minutes)
Construct a Latitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the double value of the minutes sub-unit of the SexagesimalAngleType.

Latitude

public Latitude(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                int minutes,
                double seconds)
Construct a Latitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the double value of the seconds sub-unit of the SexagesimalAngleType.

Latitude

public Latitude(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                int minutes,
                int seconds,
                int microseconds)
Construct a Latitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the integer value of the seconds sub-unit of the SexagesimalAngleType.
microseconds - the integer value of the microseconds sub-unit of the SexagesimalAngleType.
Method Detail

set

public void set(Angle ang)
Set this Latitude to the specified value.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
ang - the Angle object to duplicate.

add

public void add(Angle ang)
Add to this Latitude the passed Angle.

Specified by:
add in interface Angle
Overrides:
add in class DecimalAngle
Parameters:
ang - an Angle.

subtract

public void subtract(Angle ang)
Subtract from this Latitude the passed Angle.

Specified by:
subtract in interface Angle
Overrides:
subtract in class DecimalAngle
Parameters:
ang - an Angle.

set

public void set(DecimalAngleUnit units,
                double value)
Set the value of this Latitude to the specified DecimalAngleUnits value.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
units - the DecimalAngleUnits.
value - the double value.

add

public void add(DecimalAngleUnit units,
                double value)
Add to this Latitude the double value in the specified DecimalAngleUnits.

Specified by:
add in interface Angle
Overrides:
add in class DecimalAngle
Parameters:
units - the DecimalAngleUnits.
value - the double value.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                double unitsValue)
Set this Latitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the double value of the primary units of the SexagesimalAngleType.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                double minutes)
Set this Latitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the double value of the minutes sub-unit of the SexagesimalAngleType.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                int minutes,
                double seconds)
Set this Latitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the double value of the seconds sub-unit of the SexagesimalAngleType.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                int minutes,
                int seconds,
                int microseconds)
Set this Latitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the integer value of the seconds sub-unit of the SexagesimalAngleType.
microseconds - the integer value of the microseconds sub-unit of the SexagesimalAngleType.

setValueInMicroseconds

public void setValueInMicroseconds(SexagesimalAngleType type,
                                   long value)
Set this Latitude to the specified value of microseconds of the SexagesimalAngleType. (i.e. either in microseconds of of degree or microseconds of hour)

Specified by:
setValueInMicroseconds in interface Angle
Overrides:
setValueInMicroseconds in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
value - the long value in microseconds to set for this Angle.

add

public void add(SexagesimalAngleUnit units,
                int value)
Add to this Latitude the value in the specified SexagesimalAngleUnits.

Specified by:
add in interface Angle
Overrides:
add in class DecimalAngle
Parameters:
units - the SexagesimalAngleUnits.
value - the integer value.

addCheckRollover

public boolean addCheckRollover(SexagesimalAngleUnit units,
                                int value)
Add to this Latitude the value in the specified SexagesimalAngleUnits.

Parameters:
units - the SexagesimalAngleUnits.
value - the integer value.
Returns:
the boolean indicating that the resulting Latitude would occur on a Longitude 180 degrees ( Math.PI radians ) opposite the original Longitude.

addCheckRollover

public boolean addCheckRollover(DecimalAngleUnit units,
                                double value)
Add to this Latitude the double value in the specified DecimalAngleUnits.

Parameters:
units - the DecimalAngleUnits.
value - the double value.
Returns:
the boolean indicating that the resulting Latitude would occur on a Longitude 180 degrees ( Math.PI radians ) opposite the original Longitude.

addCheckRollover

public boolean addCheckRollover(Angle ang)
Add to this Latitude object the passed Angle object.

Parameters:
ang - an Angle object.
Returns:
the boolean indicating that the resulting Latitude would occur on a Longitude 180 degrees ( Math.PI radians ) opposite the original Longitude.

normalizeCheckRollover

protected boolean normalizeCheckRollover()
Normalize the value of this Latitude object to a value that is +/- 90 degrees ( Math.PI/2 radians ) or less. The resulting Latitude will represent the result of traveling in the specified direction from the equator for the specified number of degrees. ( e.g. )
91 degrees North will normalize to 89 degrees North, return == true
181 degrees North will normalize to 1 degree South, return == true
271 degrees North will normalize to 89 degrees South, return == false

Note: it is not necessary to invoke this method externally, as it is called internally for each method call that would modify the value of the angle.

Returns:
the boolean indicating that the normalized Latitude would occur on a Longitude 180 degrees ( Math.PI radians ) opposite the original Longitude.

normalize

public void normalize(AngleNorm option)
Overriding DecimalAngle, this method does nothing. Latitudes are automatically, internally normalized. Additionally, the AngleNorm described normalization functions apply to full revolution angle types and will produce unwanted results when applied to a half revolution angle type.

Specified by:
normalize in interface Angle
Overrides:
normalize in class DecimalAngle
Parameters:
option - the AngleNorm identifier

clone

public java.lang.Object clone()
Return a copy of this Latitude object. Overrides Cloneable.

Overrides:
clone in class DecimalAngle
Returns:
a copy of this Latitude object.

equals

public boolean equals(java.lang.Object obj)
Compare two Latitudes for equality. The result is true if and only if the argument object is not null, is a Latitude object and represents an angle of the same magnitude as this Latitude.

Two Latitude objects are equal only if the getAngle method returns the same value for both.

Overrides:
equals in class DecimalAngle
Parameters:
obj - the object to compare with
Returns:
true if the Latitudes are the same; false otherwise.

Jeospace API

Copyright © 2006 - jeospace.org