NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Re: Puzzled by Kaplan's 'Motion of the Observer in Celestial Navigation'
From: Andrés Ruiz
Date: 2011 Jun 21, 08:42 +0200
From: Andrés Ruiz
Date: 2011 Jun 21, 08:42 +0200
ANSI C code.
--
Andrés Ruiz
Navigational Algorithms
http://sites.google.com/site/navigationalalgorithms/
void AdjustmentOfCelestialCoordinates( double Hc, double Zn, double Be2, double Le2,
double *GHA_t2, double *Dec_t2 )
{
double LHA;
double sind, cosd;
sind = SIN( Be2 )*SIN( Hc )+COS( Be2 )*COS( Hc )*COS( Zn );
cosd = sqrt( 1.0-SQ(sind) );
LHA = ACOS( ( SIN( Hc )-SIN( Be2 )*sind )/ COS( Be2 )/cosd );
/* Kaplan: critero de sg !=
if( 0 <= Zn && Zn < 180.0 ) *GHA_t2 = -LHA-Le2;
else if( 180.0 <= Zn && Zn <= 360.0 ) *GHA_t2 = +LHA-Le2;
*/
if( 0 <= Zn && Zn < 180.0 ) LHA = 360.0 - LHA;
*GHA_t2 = LHA - Le2;
*Dec_t2 = ATAN( sind/cosd );
}
void RunningFix_Kaplan( double t, double GHA, double Dec,
double Be2, double Le2, double R, double V,
double tfix, double *GHA_t2, double *Dec_t2 )
{
// (B2, L2) -> (d, R) -> (B, L)
double dt = t - tfix;
double Be = DRLatitude( Be2, dt, R, V );
double Le = DRLongitude( Be2, Le2, dt, R, V );//CD: kk no usa Bmedia
double lha = LocalHourAngle( Le, GHA );
double HC = Hc( Be, Dec, lha );
double Zn = Azimut( Be, Dec, HC, lha );
AdjustmentOfCelestialCoordinates( HC, Zn, Be2, Le2, GHA_t2, Dec_t2 );
// Comprobacion (Hc, Z)t = (Hc, Z)tfix
printf( "t: Hc, Zn = %lf, %lf\n", HC, Zn );
lha = LocalHourAngle( Le2, *GHA_t2 );
HC = Hc( Be2, *Dec_t2, lha );
Zn = Azimut( Be2, *Dec_t2, HC, lha );
printf( "tfix: Hc, Zn = %lf, %lf\t%.4lf\t%.4lf\n", HC, Zn, Be, Le );
}
Andrés Ruiz
Navigational Algorithms
http://sites.google.com/site/navigationalalgorithms/