Terrenus HRPT v2.2

terrenus.orbit
Class EllipsoidModel

java.lang.Object
  extended by terrenus.orbit.EllipsoidModel

public class EllipsoidModel
extends java.lang.Object

The EllipsoidModel class converts between various different coordinate systems on an ellipsoid. In reality, the ellipsoid is just an oblate spheroid because it can have a polar radius that is different from its equatorial radius, but no third radius value. This describes the Earth and other planets fairly well.

Many of the methods in this class deal with cartesian (x,y,z) coordinates and distances in radian units, that is, all distances are divided by the equatorial radius of the ellipsoid (so a point on the equator is a distance of 1 from the center). This makes the form of the equations simpler in some cases.


Constructor Summary
EllipsoidModel(double rEquator, double rPole)
          Creates a new ellipsoid model.
 
Method Summary
 double[] ECEFToGD(double[] vector, double height, double[] output)
          Converts Earth-centered Earth-fixed coordinates to geodetic.
 double[] GCToECEF(double[] earthLoc, double radius, double[] output)
          Converts geocentric coordinates to Earth-centered Earth-fixed.
 double GCToGDLat(double phiGC, double height)
          Converts from geocentric latitude to geodetic latitude using the height of the feature above the reference ellipsoid.
 double GCToGDLat2(double phiGC, double radius)
          Converts from geocentric latitude to geodetic latitude using the distance of the feature from the center of the ellipsoid.
 double[] GDToECEF(double[] earthLoc, double height, double[] output)
          Converts geodetic coordinates to Earth-centered Earth-fixed.
 double GDToGCLat(double phiGD, double height)
          Converts from geodetic latitude to geocentric latitude.
 double getEquator()
          Gets the equatorial radius in meters.
 double[] getNormal(double[] posVector, double[] output)
          Computes the normal vector to the ellipsoid surface at the specified surface point.
 double getPolar()
          Gets the polar radius in meters.
 double[] intersect(double[] posVector, double[] dirVector, double[] output)
          Computes the intersection point between a line and the ellipsoid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EllipsoidModel

public EllipsoidModel(double rEquator,
                      double rPole)
Creates a new ellipsoid model.

Parameters:
rEquator - the radius of the equator in meters.
rPole - the radius of the pole in meters.
Method Detail

getEquator

public double getEquator()
Gets the equatorial radius in meters.


getPolar

public double getPolar()
Gets the polar radius in meters.


GDToGCLat

public double GDToGCLat(double phiGD,
                        double height)
Converts from geodetic latitude to geocentric latitude.

Parameters:
phiGD - the geodetic latitude of the feature in radians.
height - the height above the reference ellipsoid in radians.
Returns:
the geocentric latitude in radians.

GCToGDLat

public double GCToGDLat(double phiGC,
                        double height)
Converts from geocentric latitude to geodetic latitude using the height of the feature above the reference ellipsoid.

Parameters:
phiGC - the geocentric latitude of the feature in radians.
height - the height above the reference ellipsoid in radians.
Returns:
the geodetic latitude in radians.

GCToGDLat2

public double GCToGDLat2(double phiGC,
                         double radius)
Converts from geocentric latitude to geodetic latitude using the distance of the feature from the center of the ellipsoid.

Parameters:
phiGC - the geocentric latitude of the feature in radians.
radius - the distance from the center of the reference ellipsoid in radians.
Returns:
the geodetic latitude in radians.

GDToECEF

public double[] GDToECEF(double[] earthLoc,
                         double height,
                         double[] output)
Converts geodetic coordinates to Earth-centered Earth-fixed.

Parameters:
earthLoc - the geodetic Earth location as [lat,lon] in radians.
height - the height above the reference ellipsoid in radians.
output - the output coordinate array to fill. If null, an output array is created.
Returns:
the output coordinate array as [x,y,z] in radians.

GCToECEF

public double[] GCToECEF(double[] earthLoc,
                         double radius,
                         double[] output)
Converts geocentric coordinates to Earth-centered Earth-fixed.

Parameters:
earthLoc - the geocentric Earth location as [lat,lon] in radians.
radius - the location radius in radians.
output - the output coordinate array to fill. If null, an output array is created.
Returns:
the output coordinate array as [x,y,z] in radians.

ECEFToGD

public double[] ECEFToGD(double[] vector,
                         double height,
                         double[] output)
Converts Earth-centered Earth-fixed coordinates to geodetic.

Parameters:
vector - the ECEF coordinate vector as [x,y,z] in radians.
height - the height above the reference ellipsoid in radians.
output - the output Earth location to fill. If null, an output location is created.
Returns:
the output geodetic Earth location as [lat,lon] in radians.

getNormal

public double[] getNormal(double[] posVector,
                          double[] output)
Computes the normal vector to the ellipsoid surface at the specified surface point.

Parameters:
posVector - the surface position vector as [x,y,z] in radians.
output - the output vector to fill. If null, an output vector is created.
Returns:
the output unit vector as [x,y,z].

intersect

public double[] intersect(double[] posVector,
                          double[] dirVector,
                          double[] output)
Computes the intersection point between a line and the ellipsoid. The line is specified by its starting point and direction.

Parameters:
posVector - the position vector as [x,y,z] in radians.
dirVector - the unit direction vector as [x,y,z].
output - the output intersection array to fill. If null, an output location is created.
Returns:
the output intersection array as [x,y,z] in radians.

Terrenus HRPT v2.2