SG_ namespace fixes.
This commit is contained in:
@@ -69,13 +69,13 @@
|
|||||||
# define M_E 2.7182818284590452354
|
# define M_E 2.7182818284590452354
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ONE_SECOND is pi/180/60/60, or about 100 feet at earths' equator
|
// SG_ONE_SECOND is pi/180/60/60, or about 100 feet at earths' equator
|
||||||
#define ONE_SECOND 4.848136811E-6
|
#define SG_ONE_SECOND 4.848136811E-6
|
||||||
|
|
||||||
|
|
||||||
// Radius of Earth in kilometers at the equator. Another source had
|
// Radius of Earth in kilometers at the equator. Another source had
|
||||||
// 6378.165 but this is probably close enough
|
// 6378.165 but this is probably close enough
|
||||||
#define EARTH_RAD 6378.155
|
#define SG_EARTH_RAD 6378.155
|
||||||
|
|
||||||
|
|
||||||
// Earth parameters for WGS 84, taken from LaRCsim/ls_constants.h
|
// Earth parameters for WGS 84, taken from LaRCsim/ls_constants.h
|
||||||
|
|||||||
@@ -32,25 +32,25 @@ inline const int SG_SIGN(const T x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline const T SG_MIN(const T a, const T b) {
|
inline const T SG_MIN2(const T a, const T b) {
|
||||||
return a < b ? a : b;
|
return a < b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the minimum of three values
|
// return the minimum of three values
|
||||||
template <class T>
|
template <class T>
|
||||||
inline const T SG_MIN3( const T a, const T b, const T c) {
|
inline const T SG_MIN3( const T a, const T b, const T c) {
|
||||||
return (a < b ? SG_MIN (a, c) : SG_MIN (b, c));
|
return (a < b ? SG_MIN2 (a, c) : SG_MIN2 (b, c));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline const T SG_MAX(const T a, const T b) {
|
inline const T SG_MAX2(const T a, const T b) {
|
||||||
return a > b ? a : b;
|
return a > b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the maximum of three values
|
// return the maximum of three values
|
||||||
template <class T>
|
template <class T>
|
||||||
inline const T SG_MAX3 (const T a, const T b, const T c) {
|
inline const T SG_MAX3 (const T a, const T b, const T c) {
|
||||||
return (a > b ? SG_MAX (a, c) : SG_MAX (b, c));
|
return (a > b ? SG_MAX2 (a, c) : SG_MAX2 (b, c));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ double fgGeodAltFromCart(const Point3D& cp)
|
|||||||
lat_geoc = SGD_PI_2 - atan2( sqrt(cp.x()*cp.x() + cp.y()*cp.y()), cp.z() );
|
lat_geoc = SGD_PI_2 - atan2( sqrt(cp.x()*cp.x() + cp.y()*cp.y()), cp.z() );
|
||||||
radius = sqrt( cp.x()*cp.x() + cp.y()*cp.y() + cp.z()*cp.z() );
|
radius = sqrt( cp.x()*cp.x() + cp.y()*cp.y() + cp.z()*cp.z() );
|
||||||
|
|
||||||
if( ( (SGD_PI_2 - lat_geoc) < ONE_SECOND ) // near North pole
|
if( ( (SGD_PI_2 - lat_geoc) < SG_ONE_SECOND ) // near North pole
|
||||||
|| ( (SGD_PI_2 + lat_geoc) < ONE_SECOND ) ) // near South pole
|
|| ( (SGD_PI_2 + lat_geoc) < SG_ONE_SECOND ) ) // near South pole
|
||||||
{
|
{
|
||||||
result = radius - EQUATORIAL_RADIUS_M*E;
|
result = radius - EQUATORIAL_RADIUS_M*E;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -31,9 +31,6 @@
|
|||||||
SG_USING_STD(cout);
|
SG_USING_STD(cout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ONE_SECOND is pi/180/60/60, or about 100 feet at earths' equator
|
|
||||||
#define ONE_SECOND 4.848136811E-6
|
|
||||||
|
|
||||||
|
|
||||||
#define DOMAIN_ERR_DEBUG 1
|
#define DOMAIN_ERR_DEBUG 1
|
||||||
|
|
||||||
@@ -60,8 +57,8 @@ void sgGeocToGeod( double lat_geoc, double radius, double
|
|||||||
double t_lat, x_alpha, mu_alpha, delt_mu, r_alpha, l_point, rho_alpha;
|
double t_lat, x_alpha, mu_alpha, delt_mu, r_alpha, l_point, rho_alpha;
|
||||||
double sin_mu_a, denom,delt_lambda, lambda_sl, sin_lambda_sl;
|
double sin_mu_a, denom,delt_lambda, lambda_sl, sin_lambda_sl;
|
||||||
|
|
||||||
if( ( (SGD_PI_2 - lat_geoc) < ONE_SECOND ) // near North pole
|
if( ( (SGD_PI_2 - lat_geoc) < SG_ONE_SECOND ) // near North pole
|
||||||
|| ( (SGD_PI_2 + lat_geoc) < ONE_SECOND ) ) // near South pole
|
|| ( (SGD_PI_2 + lat_geoc) < SG_ONE_SECOND ) ) // near South pole
|
||||||
{
|
{
|
||||||
*lat_geod = lat_geoc;
|
*lat_geod = lat_geoc;
|
||||||
*sea_level_r = EQUATORIAL_RADIUS_M*E;
|
*sea_level_r = EQUATORIAL_RADIUS_M*E;
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ display(void)
|
|||||||
CMetarStation::for_each( dispMetarStation );
|
CMetarStation::for_each( dispMetarStation );
|
||||||
glEnd();
|
glEnd();
|
||||||
glColor3d(0.0, 0.0, 1.0);
|
glColor3d(0.0, 0.0, 1.0);
|
||||||
glutWireSphere(EARTH_RAD,32,16);
|
glutWireSphere(SG_EARTH_RAD,32,16);
|
||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
ii++;
|
ii++;
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|||||||
Reference in New Issue
Block a user