org.nevec.rjm
Class Geod

java.lang.Object
  extended by org.nevec.rjm.Geod

 class Geod
extends java.lang.Object

Solution of the inverse problem of geodesy for a oblate ellipsoid. The inverse problem of geodesy is solved given the parameters of an ellipsoid (equatorial radius and eccentricity), a common altitude of a surface above the ellipsoid, and pairs of geodetic coordinates (latitude, longitude) for a starting and a final point of a trajectory.

The first order differential equation of the smooth geodetic latitude as a function of longitude is solved by moving from one point to the next on a finite grid of equidistant sampling points on the longitude, using a predictor-only Newton approximation. The parameter which defines the initial direction in the local tangential plane is gathered by a shooting method (a starting guess is obtained from a spherical approximation) and a fixed number of iteration through the parameter space.

Since:
2008-04-12

Nested Class Summary
(package private) static interface Geod.AngleUnit
          Three enumeration values to convert angular units on user input and output
 
Field Summary
(package private)  double altit
          Altitude of the inverse problem above the ellipsoid.
(package private)  double eccen
          Eccentricity.
static double GRS80_FLAT
          The inverse flattening factor of the GRS80 model.
static double GRS80_RHO_E
          Equatorial radius of the GRS 1980 system, meters.
static double IERS_TN21_FLAT
          The inverse flattening factor of the IERS 1996 convention.
static double IERS_TN21_RHO_E
          Equatorial radius of the IERS 1996 convention, meters.
static double IERS_TN32_FLAT
          The inverse flattening factor of the IERS 2003 convention.
static double IERS_TN32_RHO_E
          Equatorial radius of the IERS 2003 convention, meters.
(package private)  double rho_equat
          Equatorial radius in meters.
(package private) static double WGS84_FLAT
          The inverse flattening factor of the WGS84 model.
static double WGS84_RHO_E
          Equatorial radius of the WGS84, meters.
 
Constructor Summary
Geod()
          Default Constructor.
Geod(double rho, double e, double h)
          Constructor.
 
Method Summary
(package private) static void adjLambdaEnd(double[] lambd)
          Adjust longitude of the final point.
 double c3shoot(double[] phi, double[] lambd, int Nsampl, int usampl, int useRad, int taylOrd)
          Perform 4 iterations on adjusting the parameter c3.
(package private)  double c3Sphere(double[] phi, double[] lambd)
          Spherical approximation to parameter c3
 double curvM(double tau)
          Equatorial radius of curvature M [m]
 double curvN(double tau)
          Curvature parameter N [m]
 double d2Edtau2(double tau)
          Derivative d^2 E/ d tau^2 [m^2]
 double d2Mdtau2(double tau)
          second Derivative d^2 M /d tau^2 [m]
(package private)  double d2sdlambda2(double tau, double c3)
          Second derivative d^2 s/d lambda^2 = (d/d lambda) (E/c3).
(package private)  double d2taudlambda2(double tau, double c3)
          Second derivative d^2 tau/d lambda^2.
(package private)  double d2Tdtau2(double tau, double c3)
          Second derivative of T with respect to tau.
(package private)  double d3sdlambda3(double tau, double c3)
          Third derivative d^3 s /d lambda ^3.
(package private)  double d3taudlambda3(double tau, double c3)
          Third derivative d^3 tau/d lambda^3.
 double dEdtau(double tau)
          Derivative d E/ d tau [m^2]
(package private)  double discrT(double tau, double c3)
          Discriminant under the square root of d tau / ds.
 double dMdtau(double tau)
          Derivative d M /d tau [m]
(package private)  double dNdtau(double tau)
          Derivative d N/d tau [m].
(package private)  double dsdlambda(double tau, double c3)
          Derivative d s/d lambda.
(package private)  double dtaudlambda(double tau, double c3)
          Derivative d tau/d lambda.
(package private)  double dtauds(double tau, double c3)
          Derivative d tau/d s [1/m].
(package private)  double dtaudsSignum(double[] phi, double[] lambd)
          Approximate sign d tau / ds
(package private)  double dTdtau(double tau, double c3)
          Derivative of T with respect to tau.
 double flatt()
          Flattening factor.
static double flatt(double e)
          Convert eccentricity to flattening factor.
(package private)  double GaussE(double tau)
          Gauss parameter E [m^2].
(package private)  double GaussG(double tau)
          Gauss parameter G [m^2].
 double[] getCartesian(double tau, double lambd)
          Convert geodetic to Cartesian coordinates.
static void main(java.lang.String[] args)
          usage: java Geod [-h altitude/m] [-s #longitude steps] [-u sfac] [-R equat radius/m] [-e eccent] [-r] [-g] [-2] phi1 lam1 phi2 lam2
Command line parameters -h followed by a floating point number specifies the altitude of the trajectory above the ellipsoid.
(package private)  double nautAngle(double tau, double c3, double north)
          Nautical course in the local oblique horizontal [rad]
(package private)  double tauShoot(double[] phi, double[] lambd, double c3, int Nsampl, int usampl, int useRad, int taylOrd)
          Compute one trajectory over the lambda interval, assuming c3 given.
(package private)  double tauTropic(double c3)
          Minimum polar distance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IERS_TN32_FLAT

public static final double IERS_TN32_FLAT
The inverse flattening factor of the IERS 2003 convention.

See Also:
Constant Field Values

IERS_TN21_FLAT

public static final double IERS_TN21_FLAT
The inverse flattening factor of the IERS 1996 convention.

See Also:
Constant Field Values

GRS80_FLAT

public static final double GRS80_FLAT
The inverse flattening factor of the GRS80 model.

See Also:
Constant Field Values

WGS84_FLAT

static final double WGS84_FLAT
The inverse flattening factor of the WGS84 model.

See Also:
Constant Field Values

IERS_TN32_RHO_E

public static final double IERS_TN32_RHO_E
Equatorial radius of the IERS 2003 convention, meters.

See Also:
Constant Field Values

IERS_TN21_RHO_E

public static final double IERS_TN21_RHO_E
Equatorial radius of the IERS 1996 convention, meters.

See Also:
Constant Field Values

GRS80_RHO_E

public static final double GRS80_RHO_E
Equatorial radius of the GRS 1980 system, meters.

See Also:
Constant Field Values

WGS84_RHO_E

public static final double WGS84_RHO_E
Equatorial radius of the WGS84, meters.

See Also:
Constant Field Values

rho_equat

double rho_equat
Equatorial radius in meters.


eccen

double eccen
Eccentricity. For the Earth close to 0.08.


altit

double altit
Altitude of the inverse problem above the ellipsoid. Value equals 0 on the ellipsoid surface. May have both signs. Measured in the same units as Geod::rho_equat.

Constructor Detail

Geod

public Geod()
Default Constructor. The variables are set to the defaults of the surface of the WGS84.


Geod

public Geod(double rho,
            double e,
            double h)
Constructor.

Parameters:
rho - equatorial radius [m]
e - eccentricity
h - altitude above the reference ellipsoid [m]
Method Detail

getCartesian

public double[] getCartesian(double tau,
                             double lambd)
Convert geodetic to Cartesian coordinates.

Parameters:
tau - the sine of the geodetic latitude
lambd - the geodetic longitude [rad]
Returns:
the three components of the Cartesian coordinates in the same units as rho_equat and altit.

curvN

public double curvN(double tau)
Curvature parameter N [m]

Parameters:
tau - sine of the latitude
Returns:
N

dNdtau

double dNdtau(double tau)
Derivative d N/d tau [m].

Parameters:
tau - sine of the latitude
Returns:
the derivative of N(tau)

flatt

public static double flatt(double e)
Convert eccentricity to flattening factor.

Parameters:
e - the (first) eccentricity
Returns:
f = 1-sqrt(1-eccentricity^2).

flatt

public double flatt()
Flattening factor.

Returns:
f = 1-sqrt(1-eccentricity^2).

curvM

public double curvM(double tau)
Equatorial radius of curvature M [m]

Parameters:
tau - sine of the latitude
Returns:
M

dMdtau

public double dMdtau(double tau)
Derivative d M /d tau [m]

Parameters:
tau - sine of the latitude
Returns:
the derivative of curvM() with respect to the parameter tau.

d2Mdtau2

public double d2Mdtau2(double tau)
second Derivative d^2 M /d tau^2 [m]

Parameters:
tau - sine of the latitude
Returns:
the second derivative of curvM() with respect to the parameter tau.

GaussE

double GaussE(double tau)
Gauss parameter E [m^2].

Parameters:
tau - sine of the latitude
Returns:
E

dEdtau

public double dEdtau(double tau)
Derivative d E/ d tau [m^2]

Parameters:
tau - sine of the latitude
Returns:
the derivative of GaussE() with respect to the parameter tau

d2Edtau2

public double d2Edtau2(double tau)
Derivative d^2 E/ d tau^2 [m^2]

Parameters:
tau - sine of the latitude
Returns:
the 2nd derivative of GaussE() with respect to the parameter tau

GaussG

double GaussG(double tau)
Gauss parameter G [m^2].

Parameters:
tau - sine of the latitude
Returns:
G
Since:
2008-04-22

tauTropic

double tauTropic(double c3)
Minimum polar distance.

Parameters:
c3 - the constant c3 along one individual trajectory
Returns:
the value of tau_m that could be reached if the trajectory were closed over the surface. That is the maximum of |sin(phi)|, or the value of |sin(phi)| where the derivative of sin(phi) with respect to the longitude becomes zero.
Since:
2008-04-22

dtaudlambda

double dtaudlambda(double tau,
                   double c3)
Derivative d tau/d lambda.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
absolute value of the derivative

dsdlambda

double dsdlambda(double tau,
                 double c3)
Derivative d s/d lambda.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
absolute value of the derivative of the path length

discrT

double discrT(double tau,
              double c3)
Discriminant under the square root of d tau / ds.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
1-tau^2-(c3/(N+h))^2.

dTdtau

double dTdtau(double tau,
              double c3)
Derivative of T with respect to tau.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
derivative of discrT() with respect to tau

d2Tdtau2

double d2Tdtau2(double tau,
                double c3)
Second derivative of T with respect to tau.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
the second derivative of discrT() with respect to tau

dtauds

double dtauds(double tau,
              double c3)
Derivative d tau/d s [1/m].

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
absolute value of the derivative

d2taudlambda2

double d2taudlambda2(double tau,
                     double c3)
Second derivative d^2 tau/d lambda^2.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
value of the derivative

d3taudlambda3

double d3taudlambda3(double tau,
                     double c3)
Third derivative d^3 tau/d lambda^3.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
value of the 2nd derivative

d2sdlambda2

double d2sdlambda2(double tau,
                   double c3)
Second derivative d^2 s/d lambda^2 = (d/d lambda) (E/c3).

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
value of the 2nd derivative

d3sdlambda3

double d3sdlambda3(double tau,
                   double c3)
Third derivative d^3 s /d lambda ^3.

Parameters:
tau - sine of the latitude
c3 - the constant c3 along one individual trajectory
Returns:
value of the third derivative

c3Sphere

double c3Sphere(double[] phi,
                double[] lambd)
Spherical approximation to parameter c3

Parameters:
phi - the latitudes at start and end [rad]
lambd - the longitudes at start and end [rad]
Returns:
the parameter c3 obtained form the spherical approximation.

dtaudsSignum

double dtaudsSignum(double[] phi,
                    double[] lambd)
Approximate sign d tau / ds

Parameters:
phi - the latitudes at start and end [rad]
lambd - the longitudes at start and end [rad]
Returns:
the sign of the square root as obtained from the spherical approximation.

adjLambdaEnd

static void adjLambdaEnd(double[] lambd)
Adjust longitude of the final point.

Parameters:
lambd - the longitudes at start and end [rad] The value of lambd[1] is adjusted to the range lambd[0]+-pi to ensure that the trajectory chooses a path along the correct hemisphere.

nautAngle

double nautAngle(double tau,
                 double c3,
                 double north)
Nautical course in the local oblique horizontal [rad]

Parameters:
tau - sine of the latitude
c3 - the directional parameter of the solution to the inverse problem [m]
north - sign of the square root, +1 or -1
Returns:
the direction angle (North over East) in the local oblique tangential plane [rad]

tauShoot

double tauShoot(double[] phi,
                double[] lambd,
                double c3,
                int Nsampl,
                int usampl,
                int useRad,
                int taylOrd)
Compute one trajectory over the lambda interval, assuming c3 given.

Parameters:
phi - start and (target) value of the geodetic latitude [rad]
lambd - start and end value of the longitude [rad]
c3 - fixed parameter of c3
Nsampl - number of steps into which the interval lambd[0]-lambd[1] is divided
usampl - if positive, each usampl'th point of the result is printed
useRad - one value of the AngleUnit to indicate which units are preferred for angles
taylOrd - the order of the Taylor approximation in the FEM. A value >=3 triggers use of a third order approximation, all others use of a 2nd order approximation.
Returns:
the overshooting of the value of tau versus the sine of phi[1] [rad]

c3shoot

public double c3shoot(double[] phi,
                      double[] lambd,
                      int Nsampl,
                      int usampl,
                      int useRad,
                      int taylOrd)
Perform 4 iterations on adjusting the parameter c3.

Parameters:
phi - the latitudes at start and end [rad]
lambd - the longitudes at start and end [rad]
Nsampl - the number of divisions of the longitude axis
usampl - undersampling factor for the printout in the converged trajectory
useRad - the unit of the angles which are reported
taylOrd - the order of the Taylor expansion of the core integral, 2 or 3.
Returns:
a convergent to the parameter c3

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
usage: java Geod [-h altitude/m] [-s #longitude steps] [-u sfac] [-R equat radius/m] [-e eccent] [-r] [-g] [-2] phi1 lam1 phi2 lam2
Command line parameters There are four mandatory parameters, the goedetic latitude and longitude of the start of the trajectory, and the geodetic latitude and longitude of the final point of the trajectory.
The standard output contains comment lines (starting with hashes) and one line per point on the trajectory with the following columns (separated by blanks):
Examples

Throws:
java.lang.Exception
Since:
2008-04-12