nsidc.spheres
Class GreatCircle

java.lang.Object
  extended bynsidc.spheres.Sphere
      extended bynsidc.spheres.GreatCircle
Direct Known Subclasses:
GreatCircleArc, SmallCircle

public class GreatCircle
extends Sphere

GreatCircle class - provides services and information relating to a great circle.

A great circle is a circle on a sphere with whose origin is at the center of the sphere. The shortest distance between any two points on a sphere is the great circle distance. Any two points on a sphere uniquely define a single great circle so long as they are not antipodal.

This class assumes a spherical earth.

See Also:
Sphere, SphericalPolygon

Field Summary
 double a
          Constant in plane equations ax+by+cz=0
 Point[] arc_point
          Points that define the great circle (arc endpoints).
 double b
          Constant in plane equations ax+by+cz=0
 double c
          Constant in plane equations ax+by+cz=0
protected  double const_term
          Constant for intermediate results.
protected  double denominator
          Constant for intermediate results.
protected  double firstX
          Tmp constant for interim results of the intersect calculations
 Point inflection_point
          Highest point achieved by the great circle.
 Point[] intersect_point
          Points for any intersections found.
 boolean is_meridian
          Boolean to track if the arc is on a meridian or not.
protected  double lin_term
          Constant for intermediate results.
protected  double m
          Constant for intermediate results.
protected  double n
          Constant for intermediate results.
protected  double numerator
          Constant for intermediate results.
protected  double p
          Constant for intermediate results.
protected  double planar_const
          Tmp constant for interim results of the intersect calculations
protected  double q
          Constant for intermediate results.
protected  double rad
          Tmp constant for interim results of the intersect calculations
protected  double scale
          Tmp constant for interim results of the intersect calculations
protected  double secondX
          Tmp constant for interim results of the intersect calculations
protected  double sphere_const
          Tmp constant for interim results of the intersect calculations
protected  double sqr_term
          Constant for intermediate results.
protected  double tmp_z
          Constant for intermediate results.
 
Fields inherited from class nsidc.spheres.Sphere
radius, Re_km
 
Constructor Summary
protected GreatCircle()
          Empty constructor - do not use.
  GreatCircle(double[] given_lat, double[] given_lon)
          Sets the points and initializes the great circle.
  GreatCircle(double given_lat0, double given_lon0, double given_lat1, double given_lon1)
          Sets the points and initializes the great circle.
  GreatCircle(Point start, Point end)
           
 
Method Summary
protected  void init()
          initializes the great circle.
 boolean intersectsGreatCircle(GreatCircle other)
          Determine if/where this great circle intersects another.
 boolean intersectsLatitude(double latitude)
          Determine if this great circle intersects a parallel.
 boolean intersectsSmallCircle(SmallCircle small)
          Determine if/where this great circle intersects a small circle.
protected  void systemLog(java.lang.String msg, int level)
          Log diagnostic messages
 java.lang.String toString()
           
 
Methods inherited from class nsidc.spheres.Sphere
degrees, degrees, getRadius, normalize, normalize, radians, radians, scalarTripleProductTest, setRadius, systemLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

arc_point

public Point[] arc_point
Points that define the great circle (arc endpoints).


intersect_point

public Point[] intersect_point
Points for any intersections found.


inflection_point

public Point inflection_point
Highest point achieved by the great circle.


a

public double a
Constant in plane equations ax+by+cz=0


b

public double b
Constant in plane equations ax+by+cz=0


c

public double c
Constant in plane equations ax+by+cz=0


is_meridian

public boolean is_meridian
Boolean to track if the arc is on a meridian or not.


planar_const

protected double planar_const
Tmp constant for interim results of the intersect calculations


sphere_const

protected double sphere_const
Tmp constant for interim results of the intersect calculations


scale

protected double scale
Tmp constant for interim results of the intersect calculations


rad

protected double rad
Tmp constant for interim results of the intersect calculations


firstX

protected double firstX
Tmp constant for interim results of the intersect calculations


secondX

protected double secondX
Tmp constant for interim results of the intersect calculations


numerator

protected double numerator
Constant for intermediate results.


denominator

protected double denominator
Constant for intermediate results.


m

protected double m
Constant for intermediate results.


n

protected double n
Constant for intermediate results.


p

protected double p
Constant for intermediate results.


q

protected double q
Constant for intermediate results.


sqr_term

protected double sqr_term
Constant for intermediate results.


lin_term

protected double lin_term
Constant for intermediate results.


const_term

protected double const_term
Constant for intermediate results.


tmp_z

protected double tmp_z
Constant for intermediate results.

Constructor Detail

GreatCircle

protected GreatCircle()
Empty constructor - do not use.


GreatCircle

public GreatCircle(double given_lat0,
                   double given_lon0,
                   double given_lat1,
                   double given_lon1)
Sets the points and initializes the great circle.


GreatCircle

public GreatCircle(double[] given_lat,
                   double[] given_lon)
Sets the points and initializes the great circle.


GreatCircle

public GreatCircle(Point start,
                   Point end)
Method Detail

init

protected void init()
initializes the great circle.


intersectsGreatCircle

public boolean intersectsGreatCircle(GreatCircle other)
Determine if/where this great circle intersects another.

The basic strategy is to convert everything to cartesian 3-space first because the math is easier. All the action takes place in cartesian space. If found the intersection points are placed in the intersect_point array.

Returns:
true if the two great circles intersect.
false if the two great circles do not intersect.
See Also:
Scene, SphericalPolygon

intersectsLatitude

public boolean intersectsLatitude(double latitude)
Determine if this great circle intersects a parallel.

The basic strategy is to convert everything to cartesian 3-space first because the math is easier. All the action takes place in cartesian space. If found the intersection points are placed in the intersect_point array.

Parameters:
latitude - The latitude of interest.
Returns:
true if the great circle intersects the parallel.
false if the great circle does not intersect the parallel.
See Also:
LatLonBoundingBox

intersectsSmallCircle

public boolean intersectsSmallCircle(SmallCircle small)
Determine if/where this great circle intersects a small circle.

The basic strategy is to convert everything to cartesian 3-space first because the math is easier. All the action takes place in cartesian space. If found the intersection points are placed in the intersect_point array.

Returns:
true if the two circles intersect.
false if the two circles do not intersect.
See Also:
Scene, SphericalPolygon

systemLog

protected void systemLog(java.lang.String msg,
                         int level)
Description copied from class: Sphere
Log diagnostic messages

Overrides:
systemLog in class Sphere
Parameters:
msg - Message to log.
level - Debug sensitivity.

toString

public java.lang.String toString()