nsidc.spheres
Class LonRange

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

public class LonRange
extends Sphere

LonRange class - provide services and information relating to a longitude range. Compensates for the dateline and whatnot.

This class assumes a spherical earth.


Field Summary
 double max
          maximum longitude in range.
 double min
          minimum longitude in range.
 
Fields inherited from class nsidc.spheres.Sphere
radius, Re_km
 
Constructor Summary
LonRange(double givenMin, double givenMax)
          Assumes West to East orientation.
LonRange(float givenMin, float givenMax)
          Assumes West to East orientation.
 
Method Summary
 boolean contains(double lon)
          Determine if the given longitude is within the range.
 boolean contains(float lon)
          Determine if the given longitude is within the range.
 boolean meldRange(double otherMin, double otherMax)
          Combine two ranges if possible.
 boolean meldRange(LonRange other_range)
          Combine two ranges if possible.
 boolean overlaps(LonRange 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 longitude in range.


max

public double max
maximum longitude in range.

Constructor Detail

LonRange

public LonRange(double givenMin,
                double givenMax)
Assumes West to East orientation. So if min > max that just means you're taking the long way round.


LonRange

public LonRange(float givenMin,
                float givenMax)
Assumes West to East orientation. So if min > max that just means you're taking the long way round.

Method Detail

contains

public boolean contains(float lon)
Determine if the given longitude is within the range.


contains

public boolean contains(double lon)
Determine if the given longitude is within the range.


overlaps

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


meldRange

public boolean meldRange(LonRange 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.\n 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()