nsidc.spheres
Class Sphere

java.lang.Object
  extended bynsidc.spheres.Sphere
Direct Known Subclasses:
GreatCircle, LatRange, LonRange, Orbit, Point, SphericalPolygon, UnitTest

public class Sphere
extends java.lang.Object

Sphere class - provides services and information relating to a sphere.

This is the base object of the spheres package. It defines the working sphere and several ustility functions the rest of the package uses.

This class assumes a spherical earth.


Field Summary
 double radius
          radius of the working Shpere We use a sphere of radius 10.0 so the numbers are reasonable.
protected  double Re_km
          Radius of the earth in km.
 
Constructor Summary
Sphere()
          Sets the radius.
 
Method Summary
 double degrees(double rad)
          Convert radians to decimal degrees.
 double degrees(float rad)
          Convert radians to decimal degrees.
 double getRadius()
          Get the radius of the sphere.
 double normalize(double lon)
          Set longitude to (-180, 180)
 float normalize(float lon)
          Set longitude to (-180, 180)
 double radians(double deg)
          Convert decimal degrees to radians.
 double radians(float deg)
          Convert decimal degrees to radians.
 int scalarTripleProductTest(Point given_point, Point start_point, Point end_point)
          Determine where a point is in relation to a line
 void setRadius(double given_radius)
          Set the radius of the sphere.
protected  void systemLog(java.lang.String msg)
          Log diagnostic messages
protected  void systemLog(java.lang.String msg, int level)
          Log diagnostic messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

public double radius
radius of the working Shpere We use a sphere of radius 10.0 so the numbers are reasonable.


Re_km

protected final double Re_km
Radius of the earth in km.

See Also:
Constant Field Values
Constructor Detail

Sphere

public Sphere()
Sets the radius.

Method Detail

getRadius

public double getRadius()
Get the radius of the sphere.


setRadius

public void setRadius(double given_radius)
Set the radius of the sphere.


normalize

public float normalize(float lon)
Set longitude to (-180, 180)

Parameters:
lon - Longitude in decimal degrees.

normalize

public double normalize(double lon)
Set longitude to (-180, 180)

Parameters:
lon - Longitude in decimal degrees.

radians

public double radians(float deg)
Convert decimal degrees to radians.

Parameters:
deg - Spherical coordinate in decimal degrees.

radians

public double radians(double deg)
Convert decimal degrees to radians.

Parameters:
deg - Spherical coordinate in decimal degrees.

degrees

public double degrees(float rad)
Convert radians to decimal degrees.


degrees

public double degrees(double rad)
Convert radians to decimal degrees.


systemLog

protected void systemLog(java.lang.String msg,
                         int level)
Log diagnostic messages

Parameters:
msg - Message to log.
level - Debug sensitivity.

systemLog

protected void systemLog(java.lang.String msg)
Log diagnostic messages

Parameters:
msg - Message to log.

scalarTripleProductTest

public int scalarTripleProductTest(Point given_point,
                                   Point start_point,
                                   Point end_point)
Determine where a point is in relation to a line

take the scalar triple product to see if a point is to the left or right of the line joining two other points.

Parameters:
given_point - Point of interest. start_point Start of line. end_point End of line.
See Also:
SphericalPolygon