// Conversions
// Arc seconds to radians // (arcsec*pi)/(3600*180) = rad
-#define ARCSEC_TO_RAD 4.84813681109535993589e-06
+#define SG_ARCSEC_TO_RAD 4.84813681109535993589e-06
// Radians to arc seconds // (rad*3600*180)/pi = arcsec
-#define RAD_TO_ARCSEC 206264.806247096355156
+#define SG_RAD_TO_ARCSEC 206264.806247096355156
// Feet to Meters
-#define FEET_TO_METER 0.3048
+#define SG_FEET_TO_METER 0.3048
// Meters to Feet
-#define METER_TO_FEET 3.28083989501312335958
+#define SG_METER_TO_FEET 3.28083989501312335958
// Meters to Nautical Miles, 1 nm = 6076.11549 feet
-#define METER_TO_NM 0.00053995680
+#define SG_METER_TO_NM 0.00053995680
// Nautical Miles to Meters
-#define NM_TO_METER 1852.0000
+#define SG_NM_TO_METER 1852.0000
// Radians to Nautical Miles, 1 nm = 1/60 of a degree
-#define NM_TO_RAD 0.00029088820866572159
+#define SG_NM_TO_RAD 0.00029088820866572159
// Nautical Miles to Radians
-#define RAD_TO_NM 3437.7467707849392526
+#define SG_RAD_TO_NM 3437.7467707849392526
// For divide by zero avoidance, this will be close enough to zero
#define SG_EPSILON 0.0000001
// printf("calc_lon_lat() offset.theta = %.2f offset.dist = %.2f\n",
// offset.theta, offset.dist);
- dist *= METER_TO_NM * NM_TO_RAD;
+ dist *= SG_METER_TO_NM * SG_NM_TO_RAD;
result.sety( asin( sin(orig.y()) * cos(dist) +
cos(orig.y()) * sin(dist) * cos(course) ) );
}
*course = tc1;
- *dist = d * RAD_TO_NM * NM_TO_METER;
+ *dist = d * SG_RAD_TO_NM * SG_NM_TO_METER;
}
#endif // _POLAR_HXX
int CMetarReport::Ceiling()
{
- return FEET_TO_METER * ((Decoded_METAR *)m_DecodedReport)->Ceiling;
+ return SG_FEET_TO_METER * ((Decoded_METAR *)m_DecodedReport)->Ceiling;
}
int CMetarReport::EstimatedCeiling()
{
- return FEET_TO_METER * ((Decoded_METAR *)m_DecodedReport)->Estimated_Ceiling;
+ return SG_FEET_TO_METER * ((Decoded_METAR *)m_DecodedReport)->Estimated_Ceiling;
}
int CMetarReport::VariableSkyLayerHeight()
{
- return FEET_TO_METER * ((Decoded_METAR *)m_DecodedReport)->VrbSkyLayerHgt;
+ return SG_FEET_TO_METER * ((Decoded_METAR *)m_DecodedReport)->VrbSkyLayerHgt;
}
int CMetarReport::SnowDepthInches()
s = t; t = strchr( s, ';' ); *t = 0; t++;
double ulongitude = decodeDMS( s );
s = t; t = strchr( s, ';' ); *t = 0; t++;
- double altitude = atoi( s ) * FEET_TO_METER;
+ double altitude = atoi( s ) * SG_FEET_TO_METER;
m_altitude = altitude;
s = t; t = strchr( s, ';' ); *t = 0; t++;
- double ualtitude = atoi( s ) * FEET_TO_METER;
+ double ualtitude = atoi( s ) * SG_FEET_TO_METER;
Point3D p( longitude, latitude, altitude+SG_EQUATORIAL_RADIUS_M );
m_locationPolar = p;
m_locationCart = sgPolarToCart3d( p );
a1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
cout << "Course to " << a1.get_id() << " is " << course << endl;
- cout << "Distance to " << a1.get_id() << " is " << distance * METER_TO_NM
+ cout << "Distance to " << a1.get_id() << " is " << distance * SG_METER_TO_NM
<< endl;
a2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
cout << "Course to " << a2.get_id() << " is " << course << endl;
- cout << "Distance to " << a2.get_id() << " is " << distance * METER_TO_NM
+ cout << "Distance to " << a2.get_id() << " is " << distance * SG_METER_TO_NM
<< endl;
cout << endl;
b1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
cout << "Course to " << b1.get_id() << " is " << course << endl;
- cout << "Distance to " << b1.get_id() << " is " << distance * METER_TO_NM
+ cout << "Distance to " << b1.get_id() << " is " << distance * SG_METER_TO_NM
<< endl;
b2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
cout << "Course to " << b2.get_id() << " is " << course << endl;
- cout << "Distance to " << b2.get_id() << " is " << distance * METER_TO_NM
+ cout << "Distance to " << b2.get_id() << " is " << distance * SG_METER_TO_NM
<< endl;
cout << endl;