sgp4ext.cpp   sgp4ext.cpp
skipping to change at line 27 skipping to change at line 27
* fix sgn * fix sgn
* changes : * changes :
* 2 apr 07 david vallado * 2 apr 07 david vallado
* fix jday floor and str lengths * fix jday floor and str lengths
* 14 aug 06 david vallado * 14 aug 06 david vallado
* original baseline * original baseline
* ---------------------------------------------------------------- */ * ---------------------------------------------------------------- */
#include "sgp4ext.h" #include "sgp4ext.h"
#include "StelUtils.hpp"
double sgn double sgn
( (
double x double x
) )
{ {
if (x < 0.0) if (x < 0.0)
{ {
return -1.0; return -1.0;
} }
skipping to change at line 187 skipping to change at line 188
if (fabs( temp ) > 1.0) if (fabs( temp ) > 1.0)
temp= sgn(temp) * 1.0; temp= sgn(temp) * 1.0;
return acos( temp ); return acos( temp );
} }
else else
return undefined; return undefined;
} // end angle } // end angle
/* ------------------------------------------------------------------------ ----- /* ------------------------------------------------------------------------ -----
* *
* function newtonnu * function newtonnu
* *
* this function solves keplers equation when the true anomaly is known. * this function solves keplers equation when the true anomaly is known.
* the mean and eccentric, parabolic, or hyperbolic anomaly is also found . * the mean and eccentric, parabolic, or hyperbolic anomaly is also found .
* the parabolic limit at 168 degree is arbitrary. the hyperbolic anomaly is also * the parabolic limit at 168 degree is arbitrary. the hyperbolic anomaly is also
* limited. the hyperbolic sine is used because it's not double valued. * limited. the hyperbolic sine is used because it's not double valued.
* *
* author : david vallado 719-573-2600 27 may 200 2 * author : david vallado 719-573-2600 27 may 200 2
* *
* revisions * revisions
skipping to change at line 285 skipping to change at line 256
e0 = atan2( sine,cose ); e0 = atan2( sine,cose );
m = e0 - ecc*sin(e0); m = e0 - ecc*sin(e0);
} }
else else
// -------------------- hyperbolic -------------------- // -------------------- hyperbolic --------------------
if ( ecc > 1.0 + small ) if ( ecc > 1.0 + small )
{ {
if ((ecc > 1.0 ) && (fabs(nu)+0.00001 < M_PI-acos(1.0 /ecc ))) if ((ecc > 1.0 ) && (fabs(nu)+0.00001 < M_PI-acos(1.0 /ecc )))
{ {
sine= ( sqrt( ecc*ecc-1.0 ) * sin(nu) ) / ( 1.0 + ec c*cos(nu) ); sine= ( sqrt( ecc*ecc-1.0 ) * sin(nu) ) / ( 1.0 + ec c*cos(nu) );
asinh( sine ); e0 = StelUtils::asinh( sine );
m = ecc*sinh(e0) - e0; m = ecc*sinh(e0) - e0;
} }
} }
else else
// ----------------- parabolic --------------------- // ----------------- parabolic ---------------------
if ( fabs(nu) < 168.0*M_PI/180.0 ) if ( fabs(nu) < 168.0*M_PI/180.0 )
{ {
e0= tan( nu*0.5 ); e0= tan( nu*0.5 );
m = e0 + (e0*e0*e0)/3.0; m = e0 + (e0*e0*e0)/3.0;
} }
End of changes. 3 change blocks.
34 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/