nsidc.spheres
Class LatRange

java.lang.Object
  extended bynsidc.spheres.Sphere
      extended bynsidc.spheres.LatRange

public class LatRange
extends Sphere

LatRange class - provide services and information relating to a latitude range. At the moment it's all fairly basic, but at some point we may need to add functionality for circular latitudes.

This class assumes a spherical earth.


Field Summary
 double max
          maximum latitude in range.
 double min
          minimum latitude in range.
 
Fields inherited from class nsidc.spheres.Sphere
radius, Re_km
 
Constructor Summary
LatRange(double givenMin, double givenMax)
          The constructors.
LatRange(float givenMin, float givenMax)
           
 
Method Summary
 boolean contains(double lat)
          Determine if the given latgitude is within the range.
 boolean contains(float lat)
          Determine if the given latitude is within the range.
 boolean meldRange(double otherMin, double otherMax)
          Combine two ranges if possible.
 boolean meldRange(LatRange other_range)
          Combine two ranges if possible.
 boolean overlaps(LatRange other_range)
          Determine if this range overlaps another.
 java.lang.String toString()
           
 
Methods inherited from class nsidc.spheres.Sphere
degrees, degrees, getRadius, normalize, normalize, radians, radians, scalarTripleProductTest, setRadius, systemLog, systemLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

public double min
minimum latitude in range.


max

public double max
maximum latitude in range.

Constructor Detail

LatRange

public LatRange(double givenMin,
                double givenMax)
The constructors.


LatRange

public LatRange(float givenMin,
                float givenMax)
Method Detail

contains

public boolean contains(float lat)
Determine if the given latitude is within the range.


contains

public boolean contains(double lat)
Determine if the given latgitude is within the range.


overlaps

public boolean overlaps(LatRange other_range)
Determine if this range overlaps another.


meldRange

public boolean meldRange(LatRange other_range)
Combine two ranges if possible.
If the two ranges overlap this range is adjusted to include the other and true is returned. The other range can then be discarded by the calling method.
If the two ranges do not overlap no changes are made and false is returned.


meldRange

public boolean meldRange(double otherMin,
                         double otherMax)
Combine two ranges if possible.
If the two ranges overlap this range is adjusted to include the other and true is returned. \n
If the two ranges do not overlap no changes are made and false is returned.


toString

public java.lang.String toString()