Check for domain error in fgGeoctoGeod()
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <Include/fg_constants.h>
|
#include <Include/fg_constants.h>
|
||||||
#include <Math/fg_geodesy.hxx>
|
#include <Math/fg_geodesy.hxx>
|
||||||
@@ -54,6 +55,13 @@ void fgGeocToGeod( double lat_geoc, double radius, double
|
|||||||
r_alpha = x_alpha/cos(lat_geoc);
|
r_alpha = x_alpha/cos(lat_geoc);
|
||||||
l_point = radius - r_alpha;
|
l_point = radius - r_alpha;
|
||||||
*alt = l_point*cos(delt_lambda);
|
*alt = l_point*cos(delt_lambda);
|
||||||
|
|
||||||
|
// check for domain error
|
||||||
|
if ( errno == EDOM ) {
|
||||||
|
cout << "Domain ERROR in fgGeocToGeod!!!!\n";
|
||||||
|
*alt = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
denom = sqrt(1-EPS*EPS*sin_mu_a*sin_mu_a);
|
denom = sqrt(1-EPS*EPS*sin_mu_a*sin_mu_a);
|
||||||
rho_alpha = EQUATORIAL_RADIUS_M*(1-EPS)/
|
rho_alpha = EQUATORIAL_RADIUS_M*(1-EPS)/
|
||||||
(denom*denom*denom);
|
(denom*denom*denom);
|
||||||
@@ -63,7 +71,14 @@ void fgGeocToGeod( double lat_geoc, double radius, double
|
|||||||
sin_lambda_sl = sin( lambda_sl );
|
sin_lambda_sl = sin( lambda_sl );
|
||||||
*sea_level_r =
|
*sea_level_r =
|
||||||
sqrt(RESQ_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl));
|
sqrt(RESQ_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl));
|
||||||
|
|
||||||
|
// check for domain error
|
||||||
|
if ( errno == EDOM ) {
|
||||||
|
cout << "Domain ERROR in fgGeocToGeod!!!!\n";
|
||||||
|
*sea_level_r = 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -139,6 +154,9 @@ void fgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
|
|||||||
|
|
||||||
$Header$
|
$Header$
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.3 1998/11/11 00:18:36 curt
|
||||||
|
Check for domain error in fgGeoctoGeod()
|
||||||
|
|
||||||
Revision 1.2 1998/10/16 23:36:36 curt
|
Revision 1.2 1998/10/16 23:36:36 curt
|
||||||
c++-ifying.
|
c++-ifying.
|
||||||
|
|
||||||
@@ -218,6 +236,9 @@ Initial Flight Gear revision.
|
|||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.3 1998/11/11 00:18:36 curt
|
||||||
|
// Check for domain error in fgGeoctoGeod()
|
||||||
|
//
|
||||||
// Revision 1.2 1998/10/16 23:36:36 curt
|
// Revision 1.2 1998/10/16 23:36:36 curt
|
||||||
// c++-ifying.
|
// c++-ifying.
|
||||||
//
|
//
|
||||||
|
|||||||
+4
-1
@@ -133,7 +133,7 @@ operator >> ( istream& in, Point3D& p)
|
|||||||
inline ostream&
|
inline ostream&
|
||||||
operator<< ( ostream& out, const Point3D& p )
|
operator<< ( ostream& out, const Point3D& p )
|
||||||
{
|
{
|
||||||
return out << p.n[PX] << ',' << p.n[PY] << ',' << p.n[PZ];
|
return out << p.n[PX] << ", " << p.n[PY] << ", " << p.n[PZ];
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
@@ -293,6 +293,9 @@ Point3D::distance3D(const Point3D& a ) const
|
|||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 1998/11/11 00:18:38 curt
|
||||||
|
// Check for domain error in fgGeoctoGeod()
|
||||||
|
//
|
||||||
// Revision 1.3 1998/10/20 18:21:49 curt
|
// Revision 1.3 1998/10/20 18:21:49 curt
|
||||||
// Tweaks from Bernie Bright.
|
// Tweaks from Bernie Bright.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user