]> git.mxchange.org Git - flightgear.git/commitdiff
SG_ namespace
authorcurt <curt>
Sat, 24 Mar 2001 04:48:44 +0000 (04:48 +0000)
committercurt <curt>
Sat, 24 Mar 2001 04:48:44 +0000 (04:48 +0000)
41 files changed:
src/Aircraft/aircraft.cxx
src/Autopilot/newauto.cxx
src/Cockpit/cockpit.cxx
src/Cockpit/hud.cxx
src/Cockpit/hud_ladr.cxx
src/Cockpit/hud_tbi.cxx
src/Cockpit/panel.cxx
src/Cockpit/radiostack.cxx
src/Cockpit/steam.cxx
src/FDM/ADA.cxx
src/FDM/LaRCsimIC.cxx
src/FDM/LaRCsimIC.hxx
src/FDM/MagicCarpet.cxx
src/FDM/flight.cxx
src/FDM/flight.hxx
src/GUI/apt_dlg.cxx
src/Main/bfi.cxx
src/Main/fg_init.cxx
src/Main/keyboard.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/ttest.cxx
src/Main/viewer_lookat.cxx
src/Main/viewer_rph.cxx
src/Navaids/ils.hxx
src/Navaids/mkrbeacons.cxx
src/Navaids/nav.hxx
src/Network/atlas.cxx
src/Network/garmin.cxx
src/Network/nmea.cxx
src/Network/pve.cxx
src/Network/rul.cxx
src/NetworkOLK/net_send.cxx
src/Objects/obj.cxx
src/Scenery/tileentry.cxx
src/Scenery/tilemgr.cxx
src/Time/light.cxx
src/Time/moonpos.cxx
src/Time/sunpos.cxx
src/WeatherCM/FGWeatherParse.cpp
tests/test-up.cxx

index 498a52968dbff272dfe450ea49ad77040c590c3c..2de2265ee834653da49de96803a7c150ed04bdc2 100644 (file)
@@ -50,8 +50,8 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
 
     FG_LOG( FG_FLIGHT, FG_DEBUG,
            "Pos = ("
-           << (f->get_Longitude() * 3600.0 * RAD_TO_DEG) << "," 
-           << (f->get_Latitude()  * 3600.0 * RAD_TO_DEG) << ","
+           << (f->get_Longitude() * 3600.0 * SGD_RADIANS_TO_DEGREES) << "," 
+           << (f->get_Latitude()  * 3600.0 * SGD_RADIANS_TO_DEGREES) << ","
            << f->get_Altitude() 
            << ")  (Phi,Theta,Psi)=("
            << f->get_Phi() << "," 
index f0b3bfbb2b7ec0c1b0806d0f391ea768ef8445f4..8fd9fc0c5e6597d17b27c66c35fce758d1bc2e5a 100644 (file)
@@ -595,7 +595,7 @@ int FGAutopilot::run() {
            double x = current_radiostack->get_nav1_gs_dist();
            double y = (FGBFI::getAltitude() 
                        - current_radiostack->get_nav1_elev()) * FEET_TO_METER;
-           double current_angle = atan2( y, x ) * RAD_TO_DEG;
+           double current_angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
            // cout << "current angle = " << current_angle << endl;
 
            double target_angle = current_radiostack->get_nav1_target_gs();
@@ -613,7 +613,7 @@ int FGAutopilot::run() {
            double horiz_vel = cur_fdm_state->get_V_ground_speed()
                * FEET_TO_METER * 60.0;
            // cout << "Horizontal vel = " << horiz_vel << endl;
-           climb_rate = -sin( des_angle * DEG_TO_RAD ) * horiz_vel;
+           climb_rate = -sin( des_angle * SGD_DEGREES_TO_RADIANS ) * horiz_vel;
            // cout << "climb_rate = " << climb_rate << endl;
            /* climb_error_accum += gs_diff * 2.0; */
            /* climb_rate = gs_diff * 200.0 + climb_error_accum; */
@@ -864,19 +864,19 @@ void FGAutopilot::set_AltitudeMode( fgAutoAltitudeMode mode ) {
 
 #if 0
 static inline double get_aoa( void ) {
-    return( cur_fdm_state->get_Gamma_vert_rad() * RAD_TO_DEG );
+    return( cur_fdm_state->get_Gamma_vert_rad() * SGD_RADIANS_TO_DEGREES );
 }
 
 static inline double fgAPget_latitude( void ) {
-    return( cur_fdm_state->get_Latitude() * RAD_TO_DEG );
+    return( cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES );
 }
 
 static inline double fgAPget_longitude( void ) {
-    return( cur_fdm_state->get_Longitude() * RAD_TO_DEG );
+    return( cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES );
 }
 
 static inline double fgAPget_roll( void ) {
-    return( cur_fdm_state->get_Phi() * RAD_TO_DEG );
+    return( cur_fdm_state->get_Phi() * SGD_RADIANS_TO_DEGREES );
 }
 
 static inline double get_pitch( void ) {
@@ -884,7 +884,7 @@ static inline double get_pitch( void ) {
 }
 
 double fgAPget_heading( void ) {
-    return( cur_fdm_state->get_Psi() * RAD_TO_DEG );
+    return( cur_fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES );
 }
 
 static inline double fgAPget_altitude( void ) {
index c29f536161f1dde7ecb9a131b5bc54cb95ffb34e..9fde360bc23b0d5f7ebf1b78bafd7596cd7db225 100644 (file)
@@ -65,7 +65,7 @@ float get_latitude( void )
 {
     double lat;
 
-    lat = current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;
+    lat = current_aircraft.fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
 
     float flat = lat;
     return(flat);
@@ -76,7 +76,7 @@ float get_lat_min( void )
 {
     double      a, d;
 
-    a = current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;    
+    a = current_aircraft.fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;    
     if (a < 0.0) {
         a = -a;
     }
@@ -90,7 +90,7 @@ float get_longitude( void )
 {
     double lon;
 
-    lon = current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;
+    lon = current_aircraft.fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
 
     float flon = lon;
     return(flon);
@@ -112,7 +112,7 @@ get_formated_gmt_time( void )
 float get_long_min( void )
 {
     double  a, d;
-    a = current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;   
+    a = current_aircraft.fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;   
     if (a < 0.0) {
         a = -a;
     }
@@ -167,7 +167,7 @@ float get_mach(void)
 
 float get_aoa( void )
 {
-    float aoa = current_aircraft.fdm_state->get_Alpha() * RAD_TO_DEG;
+    float aoa = current_aircraft.fdm_state->get_Alpha() * SGD_RADIANS_TO_DEGREES;
     return( aoa );
 }
 
@@ -185,7 +185,7 @@ float get_pitch( void )
 
 float get_heading( void )
 {
-    float heading = (current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG);
+    float heading = (current_aircraft.fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES);
     return( heading );
 }
 
@@ -276,7 +276,7 @@ float get_view_direction( void )
 {
     double view_off = SGD_2PI - globals->get_current_view()->get_view_offset();
     double view = ( current_aircraft.fdm_state->get_Psi() + view_off)
-       * RAD_TO_DEG;
+       * SGD_RADIANS_TO_DEGREES;
     
     if(view > 360.)
         view -= 360.;
index fa6f25f4d37025415ce34725cafb159cbb7da936..2ef0a162022beb99caf6092108e155d3bc67a9d9 100644 (file)
@@ -224,7 +224,7 @@ void strokeString(int x, int y, char *msg, void *font, float theta)
     if(*msg)
     {
     glPushMatrix();
-    glRotatef(theta * RAD_TO_DEG, 0.0, 0.0, 1.0);
+    glRotatef(theta * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
     sintheta = sin(theta);
     costheta = cos(theta);
     xx = (int)(x * costheta + y * sintheta);
index 5127aea01f60dfcb21196d7d104ff0bd6adcf960..96e38e2d4160faeb79989726b25af5878d56bdc8 100644 (file)
@@ -156,7 +156,7 @@ void HudLadder :: draw( void )
     wowm = get_iaux4();
     ihook = get_iaux5();
     
-    float pitch_value = current_ch1() * RAD_TO_DEG;
+    float pitch_value = current_ch1() * SGD_RADIANS_TO_DEGREES;
        
     if(hudladder_type=="Climb/Dive Ladder") {
        pitch_ladder = false;
@@ -234,11 +234,11 @@ void HudLadder :: draw( void )
                actslope = (up_vel/fabs(up_vel))*90.0;
            }
        } else {
-           actslope = atan(up_vel/ground_vel)*RAD_TO_DEG;
+           actslope = atan(up_vel/ground_vel)*SGD_RADIANS_TO_DEGREES;
        }
 
-       xvvr = (((atan2(Vyy,Vxx)*RAD_TO_DEG)-psi)*(640.0/45.0));
-       drift = ((atan2(Vyy,Vxx)*RAD_TO_DEG)-psi);
+       xvvr = (((atan2(Vyy,Vxx)*SGD_RADIANS_TO_DEGREES)-psi)*(640.0/45.0));
+       drift = ((atan2(Vyy,Vxx)*SGD_RADIANS_TO_DEGREES)-psi);
        yvvr = ((actslope - pitch_value)*factor);
        vel_y = ((actslope -pitch_value) * cos(roll_value) + drift*sin(roll_value))*factor;
        vel_x = (-(actslope -pitch_value)*sin(roll_value) + drift*cos(roll_value))*(640/45.0);
@@ -369,7 +369,7 @@ void HudLadder :: draw( void )
            t1 = up_vel/total_vel;
            t2 = asin((Vxx*Axx + Vyy*Ayy + Vzz*Azz)/(9.81*total_vel));
        }
-       pot_slope = ((t2/3)*RAD_TO_DEG)*factor + vel_y;
+       pot_slope = ((t2/3)*SGD_RADIANS_TO_DEGREES)*factor + vel_y;
        //    if (pot_slope < (vel_y - 45)) pot_slope = vel_y-45;
        //    if (pot_slope > (vel_y + 45)) pot_slope = vel_y+45;
 
@@ -413,8 +413,8 @@ void HudLadder :: draw( void )
            // ATTRIB - ON CONDITION
            glBegin(GL_LINE_STRIP);
            glVertex2f(-6, -134);
-           glVertex2f(-6, t2*RAD_TO_DEG*4.0 - 134);
-           glVertex2f(+6, t2*RAD_TO_DEG*4.0 - 134);
+           glVertex2f(-6, t2*SGD_RADIANS_TO_DEGREES*4.0 - 134);
+           glVertex2f(+6, t2*SGD_RADIANS_TO_DEGREES*4.0 - 134);
            glVertex2f(6, -134);
            glEnd();
            // OBJECT MOVING RETICLE
@@ -460,7 +460,7 @@ void HudLadder :: draw( void )
 
        }
 
-    glRotatef(roll_value * RAD_TO_DEG, 0.0, 0.0, 1.0);
+    glRotatef(roll_value * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
     // FRL marker not rotated - this line shifted below
 
     if( div_units ) {
@@ -621,10 +621,10 @@ void HudLadder :: draw( void )
        //waypoint marker computation
        float fromwp_lat,towp_lat,fromwp_lon,towp_lon,dist,delx,dely,hyp,theta,brg;
 
-       fromwp_lon = get_longitude()*DEG_TO_RAD;
-       fromwp_lat = get_latitude()*DEG_TO_RAD;
-       towp_lon = get_aux5()*DEG_TO_RAD;
-       towp_lat = get_aux6()*DEG_TO_RAD;
+       fromwp_lon = get_longitude()*SGD_DEGREES_TO_RADIANS;
+       fromwp_lat = get_latitude()*SGD_DEGREES_TO_RADIANS;
+       towp_lon = get_aux5()*SGD_DEGREES_TO_RADIANS;
+       towp_lat = get_aux6()*SGD_DEGREES_TO_RADIANS;
 
        dist = acos(sin(fromwp_lat)*sin(towp_lat)+cos(fromwp_lat)*cos(towp_lat)*cos(fabs(fromwp_lon-towp_lon)));
        delx= towp_lat - fromwp_lat;
@@ -635,13 +635,13 @@ void HudLadder :: draw( void )
        } else {
            theta = 0.0;
        }
-       brg = theta*RAD_TO_DEG;
+       brg = theta*SGD_RADIANS_TO_DEGREES;
        if (brg > 360.0) brg = 0.0;
        if (delx < 0) brg = 180 - brg;
 
        //        {Brg  = asin(cos(towp_lat)*sin(fabs(fromwp_lon-towp_lon))/ sin(dist));
-       //        Brg = Brg * RAD_TO_DEG; }
-       dist = dist*RAD_TO_DEG * 60.0*1852.0; //rad->deg->nm->m
+       //        Brg = Brg * SGD_RADIANS_TO_DEGREES; }
+       dist = dist*SGD_RADIANS_TO_DEGREES * 60.0*1852.0; //rad->deg->nm->m
        // end waypoint marker computation
        //*********************************************************
        // OBJECT MOVING RETICLE
index 0ddeaf95431cce213de2015f13a98e64994197ec..31085aba568123f263615709201df2bc86495194 100644 (file)
@@ -84,7 +84,7 @@ operator = (const fgTBI_instr & rhs )
 
      cen_x = centroid.x;
      cen_y = centroid.y;
-     bank  = bank_angle * RAD_TO_DEG;
+     bank  = bank_angle * SGD_RADIANS_TO_DEGREES;
      tee   = -tee_height;
      fspan = span;
      hole  = scr_hole;
index b16aae2f7e944bac572a8037ddaf6e0843eba1b6..6d0ac50a78f651e32af750ab71aa5d8a62c56975 100644 (file)
@@ -238,7 +238,7 @@ FGPanel::update ()
   glEnable(GL_ALPHA_TEST);
   glEnable(GL_COLOR_MATERIAL);
   // glColor4f(1.0, 1.0, 1.0, 1.0);
-  if ( cur_light_params.sun_angle * RAD_TO_DEG < 95.0 ) {
+  if ( cur_light_params.sun_angle * SGD_RADIANS_TO_DEGREES < 95.0 ) {
       glColor4fv( cur_light_params.scene_diffuse );
   } else {
       glColor4f(0.7, 0.2, 0.2, 1.0);
@@ -718,7 +718,7 @@ FGTexturedLayer::draw ()
 
                                // From Curt: turn on the panel
                                // lights after sundown.
-  if ( cur_light_params.sun_angle * RAD_TO_DEG < 95.0 ) {
+  if ( cur_light_params.sun_angle * SGD_RADIANS_TO_DEGREES < 95.0 ) {
       glColor4fv( cur_light_params.scene_diffuse );
   } else {
       glColor4f(0.7, 0.2, 0.2, 1.0);
index 81c753a47569342801171d5c89299c2c7ff41a25..89541efc3969b62111dae73a162882f19a39c098 100644 (file)
@@ -296,8 +296,8 @@ double FGRadioStack::adjustILSRange( double stationElev, double aircraftElev,
 void 
 FGRadioStack::update() 
 {
-    double lon = longitudeVal->getDoubleValue() * DEG_TO_RAD;
-    double lat = latitudeVal->getDoubleValue() * DEG_TO_RAD;
+    double lon = longitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
+    double lat = latitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
     double elev = altitudeVal->getDoubleValue() * FEET_TO_METER;
 
     need_update = false;
@@ -326,7 +326,7 @@ FGRadioStack::update()
        }
        
        // wgs84 heading
-       geo_inverse_wgs_84( elev, lat * RAD_TO_DEG, lon * RAD_TO_DEG
+       geo_inverse_wgs_84( elev, lat * SGD_RADIANS_TO_DEGREES, lon * SGD_RADIANS_TO_DEGREES
                            nav1_loclat, nav1_loclon,
                            &az1, &az2, &s );
        // cout << "az1 = " << az1 << " magvar = " << nav1_magvar << endl;
@@ -420,7 +420,7 @@ FGRadioStack::update()
        }
 
        // wgs84 heading
-       geo_inverse_wgs_84( elev, lat * RAD_TO_DEG, lon * RAD_TO_DEG
+       geo_inverse_wgs_84( elev, lat * SGD_RADIANS_TO_DEGREES, lon * SGD_RADIANS_TO_DEGREES
                            nav2_loclat, nav2_loclon,
                            &az1, &az2, &s );
        nav2_heading = az1 - nav2_magvar;
@@ -500,7 +500,7 @@ FGRadioStack::update()
        adf_dist = aircraft.distance3D( station );
 
        // wgs84 heading
-       geo_inverse_wgs_84( elev, lat * RAD_TO_DEG, lon * RAD_TO_DEG
+       geo_inverse_wgs_84( elev, lat * SGD_RADIANS_TO_DEGREES, lon * SGD_RADIANS_TO_DEGREES
                            adf_lat, adf_lon,
                            &az1, &az2, &s );
        adf_heading = az1;
@@ -550,8 +550,8 @@ FGRadioStack::update()
 // Update current nav/adf radio stations based on current postition
 void FGRadioStack::search() 
 {
-    double lon = longitudeVal->getDoubleValue() * DEG_TO_RAD;
-    double lat = latitudeVal->getDoubleValue() * DEG_TO_RAD;
+    double lon = longitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
+    double lat = latitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
     double elev = altitudeVal->getDoubleValue() * FEET_TO_METER;
 
     // nav1
@@ -807,7 +807,7 @@ void FGRadioStack::search()
     }
 
     FGBeacon::fgMkrBeacType beacon_type
-       = current_beacons->query( lon * RAD_TO_DEG, lat * RAD_TO_DEG, elev );
+       = current_beacons->query( lon * SGD_RADIANS_TO_DEGREES, lat * SGD_RADIANS_TO_DEGREES, elev );
 
     outer_marker = middle_marker = inner_marker = false;
 
@@ -939,7 +939,7 @@ double FGRadioStack::get_nav1_gs_needle_deflection() const {
     if ( nav1_inrange && nav1_has_gs ) {
        double x = nav1_gs_dist;
        double y = (FGBFI::getAltitude() - nav1_elev) * FEET_TO_METER;
-       double angle = atan2( y, x ) * RAD_TO_DEG;
+       double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
        return (nav1_target_gs - angle) * 5.0;
     } else {
        return 0.0;
@@ -953,7 +953,7 @@ double FGRadioStack::get_nav2_gs_needle_deflection() const {
     if ( nav2_inrange && nav2_has_gs ) {
        double x = nav2_gs_dist;
        double y = (FGBFI::getAltitude() - nav2_elev) * FEET_TO_METER;
-       double angle = atan2( y, x ) * RAD_TO_DEG;
+       double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
        return (nav2_target_gs - angle) * 5.0;
     } else {
        return 0.0;
index 57be7d7aa8da616a2de51793ac8f66ef54fe1d1a..680cf84fe4598c66764cf76eac9a0d083803c98b 100644 (file)
@@ -261,9 +261,9 @@ void FGSteam::_CatchUp()
        */
        set_lowpass ( & the_TC_std,
                current_aircraft.fdm_state->get_Phi_dot ()
-                       * RAD_TO_DEG / 20.0 +
+                       * SGD_RADIANS_TO_DEGREES / 20.0 +
                current_aircraft.fdm_state->get_Psi_dot ()
-                       * RAD_TO_DEG / 3.0  , dt );
+                       * SGD_RADIANS_TO_DEGREES / 3.0  , dt );
 
        /**************************
        We want to know the pilot accelerations,
@@ -283,8 +283,8 @@ void FGSteam::_CatchUp()
                double EdgN, EdgE, EdgU;
                double TrqN, TrqE, TrqU, Torque;
                /* Find a force vector towards exact magnetic north */
-               MagVar = FGBFI::getMagVar() / RAD_TO_DEG;
-               MagDip = FGBFI::getMagDip() / RAD_TO_DEG;
+               MagVar = FGBFI::getMagVar() / SGD_RADIANS_TO_DEGREES;
+               MagDip = FGBFI::getMagDip() / SGD_RADIANS_TO_DEGREES;
                CosDip = cos ( MagDip );
                FrcN = CosDip * cos ( MagVar );
                FrcE = CosDip * sin ( MagVar );
@@ -295,8 +295,8 @@ void FGSteam::_CatchUp()
                if ( AccTot > 1.0 )  AccTot = sqrt ( AccTot );
                                else AccTot = 1.0;
                /* Force applies to north marking on compass card */
-               EdgN = cos ( the_MH_err / RAD_TO_DEG );
-               EdgE = sin ( the_MH_err / RAD_TO_DEG );
+               EdgN = cos ( the_MH_err / SGD_RADIANS_TO_DEGREES );
+               EdgE = sin ( the_MH_err / SGD_RADIANS_TO_DEGREES );
                EdgU = 0.0;
                /* Apply the force to the edge to get torques */
                TrqN = EdgE * FrcU - EdgU * FrcE;
@@ -419,7 +419,7 @@ double FGSteam::get_HackGS_deg () {
        double x = current_radiostack->get_nav1_gs_dist();
        double y = (FGBFI::getAltitude() - current_radiostack->get_nav1_elev())
            * FEET_TO_METER;
-       double angle = atan2( y, x ) * RAD_TO_DEG;
+       double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
        return (current_radiostack->get_nav1_target_gs() - angle) * 5.0;
     } else {
        return 0.0;
index b2dc15c2652da45231f47f349e8170d7c1d1ff3e..a83daf24aa38a3aa11159bb952093573dc9abd78 100644 (file)
@@ -253,7 +253,7 @@ bool FGADA::copy_from_FGADA() {
     _set_Mach_number( Machno);
 
     //    printf("sr=%f\n",Sea_level_radius);
-    //    printf("psi = %f %f\n",Psi,Psi*RAD_TO_DEG);    
+    //    printf("psi = %f %f\n",Psi,Psi*SGD_RADIANS_TO_DEGREES);    
 
     // controls
     controls.set_throttle(0,throttle/131.0);
index 69af5ecdd031c35e749c86d06d4c7db497d8e630..4bd86309df4a35fc5b6fba6212fb2d08f276c9d3 100644 (file)
@@ -104,7 +104,7 @@ void LaRCsimIC::SetClimbRateFpsIC( SCALAR tt) {
     getTheta();
     vdown=-1*hdot;
     cout << "hdot: " << hdot << endl;
-    cout << "gamma: " << gamma*RAD_TO_DEG << endl;
+    cout << "gamma: " << gamma*SGD_RADIANS_TO_DEGREES << endl;
     cout << "vdown: " << vdown << endl;
   }
 }
index 00101942237931787d4accea6f749ba31f3706b1..d5a38870bd27d76de9b54224bcf15754c26d645d 100644 (file)
@@ -30,6 +30,8 @@
 INCLUDES
 *******************************************************************************/
 
+#include <plib/sg.h>
+
 #include <FDM/LaRCsim/ls_constants.h>
 #include <FDM/LaRCsim/ls_types.h>
 
@@ -69,7 +71,7 @@ public:
   void SetAltitudeAGLFtIC(SCALAR tt);
   
   //"vertical" flight path, recalculate theta
-  inline void SetFlightPathAngleDegIC(SCALAR tt) { SetFlightPathAngleRadIC(tt*DEG_TO_RAD); }
+  inline void SetFlightPathAngleDegIC(SCALAR tt) { SetFlightPathAngleRadIC(tt*SGD_DEGREES_TO_RADIANS); }
   void SetFlightPathAngleRadIC(SCALAR tt);
   
   //set speed first
@@ -77,26 +79,26 @@ public:
   void SetClimbRateFpsIC(SCALAR tt);
   
   //use currently stored gamma, recalcualte theta
-  inline void SetAlphaDegIC(SCALAR tt)      { alpha=tt*DEG_TO_RAD; getTheta(); }
+  inline void SetAlphaDegIC(SCALAR tt)      { alpha=tt*SGD_DEGREES_TO_RADIANS; getTheta(); }
   inline void SetAlphaRadIC(SCALAR tt)      { alpha=tt; getTheta(); }
   
   //use currently stored gamma, recalcualte alpha
-  inline void SetPitchAngleDegIC(SCALAR tt) { SetPitchAngleRadIC(tt*DEG_TO_RAD); }
+  inline void SetPitchAngleDegIC(SCALAR tt) { SetPitchAngleRadIC(tt*SGD_DEGREES_TO_RADIANS); }
          void SetPitchAngleRadIC(SCALAR tt);
 
-  inline void SetBetaDegIC(SCALAR tt)       { beta=tt*DEG_TO_RAD; getTheta();}
+  inline void SetBetaDegIC(SCALAR tt)       { beta=tt*SGD_DEGREES_TO_RADIANS; getTheta();}
   inline void SetBetaRadIC(SCALAR tt)       { beta=tt; getTheta(); }
   
-  inline void SetRollAngleDegIC(SCALAR tt) { phi=tt*DEG_TO_RAD; getTheta(); }
+  inline void SetRollAngleDegIC(SCALAR tt) { phi=tt*SGD_DEGREES_TO_RADIANS; getTheta(); }
   inline void SetRollAngleRadIC(SCALAR tt) { phi=tt; getTheta(); }
 
-  inline void SetHeadingDegIC(SCALAR tt)   { psi=tt*DEG_TO_RAD; }
+  inline void SetHeadingDegIC(SCALAR tt)   { psi=tt*SGD_DEGREES_TO_RADIANS; }
   inline void SetHeadingRadIC(SCALAR tt)   { psi=tt; }
 
-  inline void SetLatitudeGDDegIC(SCALAR tt)  { SetLatitudeGDRadIC(tt*DEG_TO_RAD); }
+  inline void SetLatitudeGDDegIC(SCALAR tt)  { SetLatitudeGDRadIC(tt*SGD_DEGREES_TO_RADIANS); }
          void SetLatitudeGDRadIC(SCALAR tt);
 
-  inline void SetLongitudeDegIC(SCALAR tt) { longitude=tt*DEG_TO_RAD; }
+  inline void SetLongitudeDegIC(SCALAR tt) { longitude=tt*SGD_DEGREES_TO_RADIANS; }
   inline void SetLongitudeRadIC(SCALAR tt) { longitude=tt; }
   
   void SetRunwayAltitudeFtIC(SCALAR tt);
@@ -112,32 +114,32 @@ public:
   
   inline SCALAR GetRunwayAltitudeFtIC(void) { return runway_altitude; }
 
-  inline SCALAR GetFlightPathAngleDegIC(void) { return gamma*RAD_TO_DEG; }
+  inline SCALAR GetFlightPathAngleDegIC(void) { return gamma*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetFlightPathAngleRadIC(void) { return gamma; }
 
   inline SCALAR GetClimbRateFpmIC(void) { return hdot*60; }
   inline SCALAR GetClimbRateFpsIC(void) { return hdot; }
 
-  inline SCALAR GetAlphaDegIC(void)      { return alpha*RAD_TO_DEG; }
+  inline SCALAR GetAlphaDegIC(void)      { return alpha*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetAlphaRadIC(void)      { return alpha; }
 
-  inline SCALAR GetPitchAngleDegIC(void) { return theta*RAD_TO_DEG; }
+  inline SCALAR GetPitchAngleDegIC(void) { return theta*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetPitchAngleRadIC(void) { return theta; }
 
 
-  inline SCALAR GetBetaDegIC(void)       { return beta*RAD_TO_DEG; }
-  inline SCALAR GetBetaRadIC(void)       { return beta*RAD_TO_DEG; }
+  inline SCALAR GetBetaDegIC(void)       { return beta*SGD_RADIANS_TO_DEGREES; }
+  inline SCALAR GetBetaRadIC(void)       { return beta*SGD_RADIANS_TO_DEGREES; }
 
-  inline SCALAR GetRollAngleDegIC(void) { return phi*RAD_TO_DEG; }
+  inline SCALAR GetRollAngleDegIC(void) { return phi*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetRollAngleRadIC(void) { return phi; }
 
-  inline SCALAR GetHeadingDegIC(void)   { return psi*RAD_TO_DEG; }
+  inline SCALAR GetHeadingDegIC(void)   { return psi*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetHeadingRadIC(void)   { return psi; }
 
-  inline SCALAR GetLatitudeGDDegIC(void)  { return latitude_gd*RAD_TO_DEG; }
+  inline SCALAR GetLatitudeGDDegIC(void)  { return latitude_gd*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetLatitudeGDRadIC(void) { return latitude_gd; }
 
-  inline SCALAR GetLongitudeDegIC(void) { return longitude*RAD_TO_DEG; }
+  inline SCALAR GetLongitudeDegIC(void) { return longitude*SGD_RADIANS_TO_DEGREES; }
   inline SCALAR GetLongitudeRadIC(void) { return longitude; }
 
   inline SCALAR GetUBodyFpsIC(void) { return vt*cos(alpha)*cos(beta); }
index 46816061f0d9663148025c3ab679b1faa41e2b3b..75eab022a6f4c0a8355b401eae9361146e5ba48e 100644 (file)
@@ -74,17 +74,17 @@ bool FGMagicCarpet::update( int multiloop ) {
     double lat2, lon2, az2;
     if ( speed > SG_EPSILON ) {
        geo_direct_wgs_84 ( get_Altitude(),
-                           get_Latitude() * RAD_TO_DEG,
-                           get_Longitude() * RAD_TO_DEG,
-                           get_Psi() * RAD_TO_DEG,
+                           get_Latitude() * SGD_RADIANS_TO_DEGREES,
+                           get_Longitude() * SGD_RADIANS_TO_DEGREES,
+                           get_Psi() * SGD_RADIANS_TO_DEGREES,
                            dist, &lat2, &lon2, &az2 );
 
-       _set_Longitude( lon2 * DEG_TO_RAD );
-       _set_Latitude( lat2 * DEG_TO_RAD );
+       _set_Longitude( lon2 * SGD_DEGREES_TO_RADIANS );
+       _set_Latitude( lat2 * SGD_DEGREES_TO_RADIANS );
     }
 
-    // cout << "lon error = " << fabs(end.x()*RAD_TO_DEG - lon2)
-    //      << "  lat error = " << fabs(end.y()*RAD_TO_DEG - lat2)
+    // cout << "lon error = " << fabs(end.x()*SGD_RADIANS_TO_DEGREES - lon2)
+    //      << "  lat error = " << fabs(end.y()*SGD_RADIANS_TO_DEGREES - lat2)
     //      << endl;
 
     double sl_radius, lat_geoc;
index ec8707dc37a39ad1ebeb9ccfcf439c58e4b93898..b7efd3490cafdea54a480bc61013ba157c7d4633 100644 (file)
@@ -283,7 +283,7 @@ void FGInterface::_updatePosition( double lat_geoc, double lon, double alt ) {
            << " tmp_alt = " << tmp_alt * METER_TO_FEET
            << " sl_radius1 = " << sl_radius1 * METER_TO_FEET
            << " sl_radius2 = " << sl_radius2 * METER_TO_FEET
-           << " Equator = " << EQUATORIAL_RADIUS_FT );
+           << " Equator = " << SG_EQUATORIAL_RADIUS_FT );
 
     _set_Geocentric_Position( lat_geoc, lon, 
                              sl_radius2 * METER_TO_FEET + alt );
index da905abb0f14b2e9d792111a73ab96901c336620..86d2ca5235817f38797f1da290b8d2fa2f1999ac 100644 (file)
@@ -496,10 +496,10 @@ public:
     virtual void set_Altitude(double alt);  // triggers re-calc of AGL altitude
     virtual void set_AltitudeAGL(double altagl); // and vice-versa
     virtual void set_Latitude_deg (double lat) {
-      set_Latitude(lat * DEG_TO_RAD);
+      set_Latitude(lat * SGD_DEGREES_TO_RADIANS);
     }
     virtual void set_Longitude_deg (double lon) {
-      set_Longitude(lon * DEG_TO_RAD);
+      set_Longitude(lon * SGD_DEGREES_TO_RADIANS);
     }
     
     // Speeds -- setting any of these will trigger a re-calc of the rest
@@ -525,11 +525,11 @@ public:
     virtual void set_Psi (double psi) { 
       set_Euler_Angles(get_Phi(), get_Theta(), psi);
     }
-    virtual void set_Phi_deg (double phi) { set_Phi(phi * DEG_TO_RAD); }
+    virtual void set_Phi_deg (double phi) { set_Phi(phi * SGD_DEGREES_TO_RADIANS); }
     virtual void set_Theta_deg (double theta) {
-      set_Theta(theta * DEG_TO_RAD); 
+      set_Theta(theta * SGD_DEGREES_TO_RADIANS); 
     }
-    virtual void set_Psi_deg (double psi) { set_Psi(psi * DEG_TO_RAD); }
+    virtual void set_Psi_deg (double psi) { set_Psi(psi * SGD_DEGREES_TO_RADIANS); }
     
     // Flight Path
     virtual void set_Climb_Rate( double roc);
@@ -891,19 +891,19 @@ public:
     inline double get_Altitude_AGL(void) const { return altitude_agl; }
 
     inline double get_Latitude_deg () const {
-      return get_Latitude() * RAD_TO_DEG;
+      return get_Latitude() * SGD_RADIANS_TO_DEGREES;
     }
     inline double get_Longitude_deg () const {
-      return get_Longitude() * RAD_TO_DEG;
+      return get_Longitude() * SGD_RADIANS_TO_DEGREES;
     }
 
     // inline double * get_Euler_angles_v() { return euler_angles_v; }
     inline double get_Phi() const { return euler_angles_v[0]; }
     inline double get_Theta() const { return euler_angles_v[1]; }
     inline double get_Psi() const { return euler_angles_v[2]; }
-    inline double get_Phi_deg () const { return get_Phi() * RAD_TO_DEG; }
-    inline double get_Theta_deg () const { return get_Theta() * RAD_TO_DEG; }
-    inline double get_Psi_deg () const { return get_Psi() * RAD_TO_DEG; }
+    inline double get_Phi_deg () const { return get_Phi() * SGD_RADIANS_TO_DEGREES; }
+    inline double get_Theta_deg () const { return get_Theta() * SGD_RADIANS_TO_DEGREES; }
+    inline double get_Psi_deg () const { return get_Psi() * SGD_RADIANS_TO_DEGREES; }
 
 
     // ========== Miscellaneous quantities ==========
index 1c7d7f3e2b049247b6e33dff96664aa109249aec..9b6f24bf2946b86a9dbd943f4c2cfca3c94564bd 100644 (file)
@@ -83,7 +83,7 @@ void AptDialog_OK (puObject *)
                        // fgSetPosFromAirportID( AptId );
                        fgSetPosFromAirportIDandHdg( AptId, 
                                                     cur_fdm_state->get_Psi() *
-                                                    RAD_TO_DEG);
+                                                    SGD_RADIANS_TO_DEGREES);
                        BusyCursor(0);
                        fgReInitSubsystems();
                        BusyCursor(1);
index ac28102750bf29c4e024e59ab9c1396c6dc3ca61..8a90188e2ec7b5b21ed4517f3ac4aced35cab370 100644 (file)
@@ -153,8 +153,8 @@ _set_view_from_axes ()
       viewDir = 270;
   }
 
-  globals->get_current_view()->set_goal_view_offset(viewDir*DEG_TO_RAD);
-//   globals->get_current_view()->set_view_offset(viewDir*DEG_TO_RAD);
+  globals->get_current_view()->set_goal_view_offset(viewDir*SGD_DEGREES_TO_RADIANS);
+//   globals->get_current_view()->set_view_offset(viewDir*SGD_DEGREES_TO_RADIANS);
 }
 
 // END: kludge
@@ -362,7 +362,7 @@ FGBFI::getGMTString ()
 double
 FGBFI::getLatitude ()
 {
-  return current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;
+  return current_aircraft.fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
 }
 
 
@@ -372,7 +372,7 @@ FGBFI::getLatitude ()
 void
 FGBFI::setLatitude (double latitude)
 {
-  current_aircraft.fdm_state->set_Latitude(latitude * DEG_TO_RAD);
+  current_aircraft.fdm_state->set_Latitude(latitude * SGD_DEGREES_TO_RADIANS);
 }
 
 
@@ -382,7 +382,7 @@ FGBFI::setLatitude (double latitude)
 double
 FGBFI::getLongitude ()
 {
-  return current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;
+  return current_aircraft.fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
 }
 
 
@@ -392,7 +392,7 @@ FGBFI::getLongitude ()
 void
 FGBFI::setLongitude (double longitude)
 {
-  current_aircraft.fdm_state->set_Longitude(longitude * DEG_TO_RAD);
+  current_aircraft.fdm_state->set_Longitude(longitude * SGD_DEGREES_TO_RADIANS);
 }
 
 
@@ -440,7 +440,7 @@ FGBFI::setAltitude (double altitude)
 double
 FGBFI::getHeading ()
 {
-  return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG;
+  return current_aircraft.fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES;
 }
 
 
@@ -450,7 +450,7 @@ FGBFI::getHeading ()
 double
 FGBFI::getHeadingMag ()
 {
-  return current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG - getMagVar();
+  return current_aircraft.fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES - getMagVar();
 }
 
 
@@ -462,7 +462,7 @@ FGBFI::setHeading (double heading)
 {
   FGInterface * fdm = current_aircraft.fdm_state;
   fdm->set_Euler_Angles(fdm->get_Phi(), fdm->get_Theta(),
-                       heading * DEG_TO_RAD);
+                       heading * SGD_DEGREES_TO_RADIANS);
 }
 
 
@@ -472,7 +472,7 @@ FGBFI::setHeading (double heading)
 double
 FGBFI::getPitch ()
 {
-  return current_aircraft.fdm_state->get_Theta() * RAD_TO_DEG;
+  return current_aircraft.fdm_state->get_Theta() * SGD_RADIANS_TO_DEGREES;
 }
 
 
@@ -483,7 +483,7 @@ void
 FGBFI::setPitch (double pitch)
 {
   FGInterface * fdm = current_aircraft.fdm_state;
-  fdm->set_Euler_Angles(fdm->get_Phi(), pitch * DEG_TO_RAD, fdm->get_Psi());
+  fdm->set_Euler_Angles(fdm->get_Phi(), pitch * SGD_DEGREES_TO_RADIANS, fdm->get_Psi());
 }
 
 
@@ -493,7 +493,7 @@ FGBFI::setPitch (double pitch)
 double
 FGBFI::getRoll ()
 {
-  return current_aircraft.fdm_state->get_Phi() * RAD_TO_DEG;
+  return current_aircraft.fdm_state->get_Phi() * SGD_RADIANS_TO_DEGREES;
 }
 
 
@@ -504,7 +504,7 @@ void
 FGBFI::setRoll (double roll)
 {
   FGInterface * fdm = current_aircraft.fdm_state;
-  fdm->set_Euler_Angles(roll * DEG_TO_RAD, fdm->get_Theta(), fdm->get_Psi());
+  fdm->set_Euler_Angles(roll * SGD_DEGREES_TO_RADIANS, fdm->get_Theta(), fdm->get_Psi());
 }
 
 
@@ -1375,7 +1375,7 @@ FGBFI::setViewAxisLat (double axis)
 double
 FGBFI::getMagVar ()
 {
-  return globals->get_mag()->get_magvar() * RAD_TO_DEG;
+  return globals->get_mag()->get_magvar() * SGD_RADIANS_TO_DEGREES;
 }
 
 
@@ -1385,7 +1385,7 @@ FGBFI::getMagVar ()
 double
 FGBFI::getMagDip ()
 {
-  return globals->get_mag()->get_magdip() * RAD_TO_DEG;
+  return globals->get_mag()->get_magdip() * SGD_RADIANS_TO_DEGREES;
 }
 
 
index e37b307dd0cd1fabb23dcda664cead01d96bca96..44117baa2feed4505bffb6aa6b8d1c22cc6e0b19 100644 (file)
@@ -410,8 +410,8 @@ bool fgInitPosition( void ) {
     string id = fgGetString("/sim/startup/airport-id");
 
     // set initial position from default or command line coordinates
-    f->set_Longitude( fgGetDouble("/position/longitude") * DEG_TO_RAD );
-    f->set_Latitude( fgGetDouble("/position/latitude") * DEG_TO_RAD );
+    f->set_Longitude( fgGetDouble("/position/longitude") * SGD_DEGREES_TO_RADIANS );
+    f->set_Latitude( fgGetDouble("/position/latitude") * SGD_DEGREES_TO_RADIANS );
 
     FG_LOG( FG_GENERAL, FG_INFO,
            "scenery.cur_elev = " << scenery.cur_elev );
@@ -438,8 +438,8 @@ bool fgInitPosition( void ) {
     f->set_Altitude( fgGetDouble("/position/altitude") );
     FG_LOG( FG_GENERAL, FG_INFO,
            "Initial position is: ("
-           << (f->get_Longitude() * RAD_TO_DEG) << ", "
-           << (f->get_Latitude() * RAD_TO_DEG) << ", "
+           << (f->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", "
+           << (f->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", "
            << (f->get_Altitude() * FEET_TO_METER) << ")" );
 
     return true;
@@ -620,8 +620,8 @@ bool fgInitSubsystems( void ) {
 
     FG_LOG( FG_GENERAL, FG_INFO,
            "Updated position (after elevation adj): ("
-           << (cur_fdm_state->get_Latitude() * RAD_TO_DEG) << ", "
-           << (cur_fdm_state->get_Longitude() * RAD_TO_DEG) << ", "
+           << (cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", "
+           << (cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", "
            << (cur_fdm_state->get_Altitude() * FEET_TO_METER) << ")" );
 
     // We need to calculate a few sea_level_radius here so we can pass
@@ -642,9 +642,9 @@ bool fgInitSubsystems( void ) {
 
     // Initial Orientation
 //     cur_fdm_state->
-//     set_Euler_Angles( fgGetDouble("/orientation/roll") * DEG_TO_RAD,
-//                       fgGetDouble("/orientation/pitch") * DEG_TO_RAD,
-//                       fgGetDouble("/orientation/heading") * DEG_TO_RAD );
+//     set_Euler_Angles( fgGetDouble("/orientation/roll") * SGD_DEGREES_TO_RADIANS,
+//                       fgGetDouble("/orientation/pitch") * SGD_DEGREES_TO_RADIANS,
+//                       fgGetDouble("/orientation/heading") * SGD_DEGREES_TO_RADIANS );
 
     // Initialize the event manager
     global_events.Init();
@@ -794,8 +794,8 @@ bool fgInitSubsystems( void ) {
 
     FG_LOG( FG_GENERAL, FG_INFO,
            "Updated position (after elevation adj): ("
-           << (cur_fdm_state->get_Latitude() * RAD_TO_DEG) << ", "
-           << (cur_fdm_state->get_Longitude() * RAD_TO_DEG) << ", "
+           << (cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", "
+           << (cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", "
            << (cur_fdm_state->get_Altitude() * FEET_TO_METER) << ")" );
     // *ABCD* end of thing that I just stuck in that I should probably
     // move
@@ -906,9 +906,9 @@ void fgReInitSubsystems( void )
 
     // Initial Orientation
 //     cur_fdm_state->
-//     set_Euler_Angles( fgGetDouble("/orientation/roll") * DEG_TO_RAD,
-//                       fgGetDouble("/orientation/pitch") * DEG_TO_RAD,
-//                       fgGetDouble("/orientation/heading") * DEG_TO_RAD );
+//     set_Euler_Angles( fgGetDouble("/orientation/roll") * SGD_DEGREES_TO_RADIANS,
+//                       fgGetDouble("/orientation/pitch") * SGD_DEGREES_TO_RADIANS,
+//                       fgGetDouble("/orientation/heading") * SGD_DEGREES_TO_RADIANS );
 
     // Initialize view parameters
     FGViewerRPH *pilot_view =
index ed96a39cd1816f5acad8fd7e19788e76eaa14740..e98483d16040fb94c8cf6621347c68cbedabad7b 100644 (file)
@@ -348,8 +348,8 @@ void GLUTkey(unsigned char k, int x, int y) {
            globals->set_freeze( ! globals->get_freeze() );
 
            {
-               SGBucket p( f->get_Longitude() * RAD_TO_DEG,
-                           f->get_Latitude() * RAD_TO_DEG );
+               SGBucket p( f->get_Longitude() * SGD_RADIANS_TO_DEGREES,
+                           f->get_Latitude() * SGD_RADIANS_TO_DEGREES );
                FGPath tile_path( globals->get_fg_root() );
                tile_path.append( "Scenery" );
                tile_path.append( p.gen_base_path() );
@@ -357,14 +357,14 @@ void GLUTkey(unsigned char k, int x, int y) {
 
                // printf position and attitude information
                FG_LOG( FG_INPUT, FG_INFO,
-                       "Lon = " << f->get_Longitude() * RAD_TO_DEG
-                       << "  Lat = " << f->get_Latitude() * RAD_TO_DEG
+                       "Lon = " << f->get_Longitude() * SGD_RADIANS_TO_DEGREES
+                       << "  Lat = " << f->get_Latitude() * SGD_RADIANS_TO_DEGREES
                        << "  Altitude = " << f->get_Altitude() * FEET_TO_METER
                        );
                FG_LOG( FG_INPUT, FG_INFO,
-                       "Heading = " << f->get_Psi() * RAD_TO_DEG 
-                       << "  Roll = " << f->get_Phi() * RAD_TO_DEG
-                       << "  Pitch = " << f->get_Theta() * RAD_TO_DEG );
+                       "Heading = " << f->get_Psi() * SGD_RADIANS_TO_DEGREES 
+                       << "  Roll = " << f->get_Phi() * SGD_RADIANS_TO_DEGREES
+                       << "  Pitch = " << f->get_Theta() * SGD_RADIANS_TO_DEGREES );
                FG_LOG( FG_INPUT, FG_INFO, tile_path.c_str());
            }
            return;
@@ -534,8 +534,8 @@ void GLUTspecialkey(int k, int x, int y) {
                if ( global_tile_mgr.init() ) {
                    // Load the local scenery data
                    global_tile_mgr.update( 
-                       cur_fdm_state->get_Longitude() * RAD_TO_DEG,
-                       cur_fdm_state->get_Latitude() * RAD_TO_DEG );
+                       cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES,
+                       cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES );
                } else {
                    FG_LOG( FG_GENERAL, FG_ALERT, 
                            "Error in Tile Manager initialization!" );
index aa5ef3958ecb1f06d3c2879cace10905f3e9a6ed..38e4aaf3a03d0e63cacf2d0937b8c7af8ae4a6d3 100644 (file)
@@ -369,8 +369,8 @@ void fgRenderFrame( void ) {
        sgCopyVec3( wup, pilot_view->get_world_up() );
        sgMat4 CXFM;            // chase view + pilot offset xform
        sgMakeRotMat4( CXFM,
-                      chase_view->get_view_offset() * RAD_TO_DEG -
-                      cur_fdm_state->get_Psi() * RAD_TO_DEG,
+                      chase_view->get_view_offset() * SGD_RADIANS_TO_DEGREES -
+                      cur_fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES,
                       wup );
        sgVec3 npo;             // new pilot offset after rotation
         sgVec3 *pPO = PilotOffsetGet();
@@ -832,8 +832,8 @@ void fgUpdateTimeDepCalcs() {
        tmp -= SGD_2PI;
     }
     /* printf("Psi = %.2f, viewoffset = %.2f sunrot = %.2f rottosun = %.2f\n",
-          FG_Psi * RAD_TO_DEG, current_view.view_offset * RAD_TO_DEG
-          -(l->sun_rotation+SGD_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
+          FG_Psi * SGD_RADIANS_TO_DEGREES, current_view.view_offset * SGD_RADIANS_TO_DEGREES
+          -(l->sun_rotation+SGD_PI) * SGD_RADIANS_TO_DEGREES, tmp * SGD_RADIANS_TO_DEGREES); */
     l->UpdateAdjFog();
 
     // Update solar system
@@ -1024,8 +1024,8 @@ static void fgMainLoop( void ) {
 #endif
 
     // see if we need to load any new scenery tiles
-    global_tile_mgr.update( cur_fdm_state->get_Longitude() * RAD_TO_DEG,
-                           cur_fdm_state->get_Latitude() * RAD_TO_DEG );
+    global_tile_mgr.update( cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES,
+                           cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES );
 
     // Process/manage pending events
     global_events.Process();
@@ -1449,8 +1449,8 @@ int main( int argc, char **argv ) {
     // Initialize time
     FGPath zone( globals->get_fg_root() );
     zone.append( "Timezone" );
-    SGTime *t = new SGTime( fgGetDouble("/position/longitude") * DEG_TO_RAD,
-                           fgGetDouble("/position/latitude") * DEG_TO_RAD,
+    SGTime *t = new SGTime( fgGetDouble("/position/longitude") * SGD_DEGREES_TO_RADIANS,
+                           fgGetDouble("/position/latitude") * SGD_DEGREES_TO_RADIANS,
                            zone.str() );
 
     // Handle potential user specified time offsets
@@ -1696,8 +1696,8 @@ void fgLoadDCS(void) {
 /*             cout << endl << obj_filename << " " << obj_lat[objc] << " " << obj_lon[objc] <<  " " << obj_alt[objc] << endl;
                int chj=getchar();*/
                 
-             obj_lon[objc] *=DEG_TO_RAD;
-       obj_lat[objc] *=DEG_TO_RAD;
+             obj_lon[objc] *=SGD_DEGREES_TO_RADIANS;
+       obj_lat[objc] *=SGD_DEGREES_TO_RADIANS;
     
             ship_pos[objc] = new ssgTransform;
        
@@ -1742,14 +1742,14 @@ void fgUpdateDCS (void) {
 
     if (fgGetString("/sim/flight-model") == "ada")
     {
-      obj_lon[0] = fdm->get_aux5()*DEG_TO_RAD;
-      obj_lat[0] = fdm->get_aux6()*DEG_TO_RAD;
+      obj_lon[0] = fdm->get_aux5()*SGD_DEGREES_TO_RADIANS;
+      obj_lat[0] = fdm->get_aux6()*SGD_DEGREES_TO_RADIANS;
       obj_alt[0] = fdm->get_aux7();
     }
     
     for (int m=0; m<=objc; m++)
     {
-       //cout << endl <<  obj_lat[m]*RAD_TO_DEG << " " << obj_lon[m]*RAD_TO_DEG << " " << obj_alt[m] << " " << objc << endl;
+       //cout << endl <<  obj_lat[m]*SGD_RADIANS_TO_DEGREES << " " << obj_lon[m]*SGD_RADIANS_TO_DEGREES << " " << obj_alt[m] << " " << objc << endl;
        //int v=getchar();
 
         //Geodetic to Geocentric angles for rotation
@@ -1776,8 +1776,8 @@ void fgUpdateDCS (void) {
        sgSetVec3( ship_up, 0.0, 0.0, 1.0); //north,yaw
 
        sgMat4 sgROT_lon, sgROT_lat, sgROT_hdg;
-       sgMakeRotMat4( sgROT_lon, obj_lon[m]*RAD_TO_DEG, ship_up );
-       sgMakeRotMat4( sgROT_lat, 90-obj_latgc*RAD_TO_DEG, ship_rt );
+       sgMakeRotMat4( sgROT_lon, obj_lon[m]*SGD_RADIANS_TO_DEGREES, ship_up );
+       sgMakeRotMat4( sgROT_lat, 90-obj_latgc*SGD_RADIANS_TO_DEGREES, ship_rt );
        sgMakeRotMat4( sgROT_hdg, 180.0, ship_up );
        
        sgMat4 sgTUX;
index b64ebfd718f7bede931d62f6ad01ea2f25f6ca58..669e1640ef21a18a0fd2a3018390012f340cd8f2 100644 (file)
@@ -826,7 +826,7 @@ parse_option (const string& arg)
        } else if ( woffset == "CENTER" ) {
            default_view_offset = 0.00;
        } else {
-           default_view_offset = atof( woffset.c_str() ) * DEG_TO_RAD;
+           default_view_offset = atof( woffset.c_str() ) * SGD_DEGREES_TO_RADIANS;
        }
        FGViewerRPH *pilot_view =
            (FGViewerRPH *)globals->get_viewmgr()->get_view( 0 );
@@ -855,7 +855,7 @@ parse_option (const string& arg)
        dir += 180;
        if (dir >= 360)
          dir -= 360;
-       dir *= DEG_TO_RAD;
+       dir *= SGD_DEGREES_TO_RADIANS;
        fgSetDouble("/environment/wind-north",
                                             speed * cos(dir));
        fgSetDouble("/environment/wind-east",
index 312ba3fa1decf90808eb085303a947fd2d46b89f..e6eb86376e2699fc978a3987a236bca22968c4d7 100644 (file)
@@ -12,10 +12,10 @@ main() {
     double FG_Phi = 0.00;
     double FG_Theta = 0.00;
     double FG_Psi = 0.00;
-    // double FG_Latitude = 33.3528917 * DEG_TO_RAD;
+    // double FG_Latitude = 33.3528917 * SGD_DEGREES_TO_RADIANS;
     double FG_Latitude = 0.0;
-    // double FG_Longitude = -110.6642444 * DEG_TO_RAD;
-    double FG_Longitude = 90.0 * DEG_TO_RAD;
+    // double FG_Longitude = -110.6642444 * SGD_DEGREES_TO_RADIANS;
+    double FG_Longitude = 90.0 * SGD_DEGREES_TO_RADIANS;
     // double view_pos[] = {2936.3222, 1736.9243, 3689.5359, 1.0};
     double view_pos[] = {0.0, 0.0, 0.0, 1.0};
 
index 37f8748fe1f0ab0cecf2681509e8bacd95e97bfe..e717c86c10cbdcbad0159962561f0dd3668e1ea1 100644 (file)
@@ -163,9 +163,9 @@ void FGViewerLookAt::update() {
 
     // Make the world up rotation matrix
     sgMakeRotMat4( UP, 
-                  geod_view_pos[0] * RAD_TO_DEG,
+                  geod_view_pos[0] * SGD_RADIANS_TO_DEGREES,
                   0.0,
-                  -geod_view_pos[1] * RAD_TO_DEG );
+                  -geod_view_pos[1] * SGD_RADIANS_TO_DEGREES );
 
     // use a clever observation into the nature of our tranformation
     // matrix to grab the world_up vector
@@ -200,7 +200,7 @@ void FGViewerLookAt::update() {
     sgNegateVec3(world_down, world_up);
     sgVectorProductVec3(surface_east, surface_south, world_down);
 #else
-    sgMakeRotMat4( TMP, SGD_PI_2 * RAD_TO_DEG, world_up );
+    sgMakeRotMat4( TMP, SGD_PI_2 * SGD_RADIANS_TO_DEGREES, world_up );
     // cout << "sgMat4 TMP" << endl;
     // print_sgMat4( TMP );
     sgXformVec3(surface_east, surface_south, TMP);
index 04d131ca75a0a9ef5e574873e1c29e7ae2d83bfc..602013a40170d7d359b91376b0031ad81a5e9c77 100644 (file)
@@ -206,12 +206,12 @@ void FGViewerRPH::update() {
     sgVec3 rollvec;
     sgSetVec3( rollvec, 0.0, 0.0, 1.0 );
     sgMat4 PHI;                // roll
-    sgMakeRotMat4( PHI, rph[0] * RAD_TO_DEG, rollvec );
+    sgMakeRotMat4( PHI, rph[0] * SGD_RADIANS_TO_DEGREES, rollvec );
 
     sgVec3 pitchvec;
     sgSetVec3( pitchvec, 0.0, 1.0, 0.0 );
     sgMat4 THETA;              // pitch
-    sgMakeRotMat4( THETA, rph[1] * RAD_TO_DEG, pitchvec );
+    sgMakeRotMat4( THETA, rph[1] * SGD_RADIANS_TO_DEGREES, pitchvec );
 
     // ROT = PHI * THETA
     sgMat4 ROT;
@@ -222,7 +222,7 @@ void FGViewerRPH::update() {
     sgVec3 yawvec;
     sgSetVec3( yawvec, 1.0, 0.0, 0.0 );
     sgMat4 PSI;                // heading
-    sgMakeRotMat4( PSI, -rph[2] * RAD_TO_DEG, yawvec );
+    sgMakeRotMat4( PSI, -rph[2] * SGD_RADIANS_TO_DEGREES, yawvec );
 
     // LOCAL = ROT * PSI
     // sgMultMat4( LOCAL, ROT, PSI );
@@ -235,9 +235,9 @@ void FGViewerRPH::update() {
     // print_sgMat4( LOCAL );
        
     sgMakeRotMat4( UP, 
-                  geod_view_pos[0] * RAD_TO_DEG,
+                  geod_view_pos[0] * SGD_RADIANS_TO_DEGREES,
                   0.0,
-                  -geod_view_pos[1] * RAD_TO_DEG );
+                  -geod_view_pos[1] * SGD_RADIANS_TO_DEGREES );
 
     sgSetVec3( world_up, UP[0][0], UP[0][1], UP[0][2] );
     // sgXformVec3( world_up, UP );
@@ -272,7 +272,7 @@ void FGViewerRPH::update() {
     sgXformVec3( pilot_offset_world, pilot_offset_world, VIEWo );
 
     // generate the view offset matrix
-    sgMakeRotMat4( VIEW_OFFSET, view_offset * RAD_TO_DEG, view_up );
+    sgMakeRotMat4( VIEW_OFFSET, view_offset * SGD_RADIANS_TO_DEGREES, view_up );
     // cout << "VIEW_OFFSET matrix" << endl;
     // print_sgMat4( VIEW_OFFSET );
     sgXformVec3( view_forward, forward, VIEW_OFFSET );
@@ -326,7 +326,7 @@ void FGViewerRPH::update() {
     sgNegateVec3(world_down, world_up);
     sgVectorProductVec3(surface_east, surface_south, world_down);
 #else
-    sgMakeRotMat4( TMP, SGD_PI_2 * RAD_TO_DEG, world_up );
+    sgMakeRotMat4( TMP, SGD_PI_2 * SGD_RADIANS_TO_DEGREES, world_up );
     // cout << "sgMat4 TMP" << endl;
     // print_sgMat4( TMP );
     sgXformVec3(surface_east, surface_south, TMP);
index 37fd9fd5b2f712379a4a476f765e1df60f816077..4c59b47df4e3d19bbf9751ed0cfbcef61981ca22 100644 (file)
@@ -142,7 +142,7 @@ operator >> ( istream& in, FGILS& i )
     // generate cartesian coordinates
     Point3D geod, cart;
 
-    geod = Point3D( i.loclon * DEG_TO_RAD, i.loclat * DEG_TO_RAD, i.gselev );
+    geod = Point3D( i.loclon * SGD_DEGREES_TO_RADIANS, i.loclat * SGD_DEGREES_TO_RADIANS, i.gselev );
     cart = sgGeodToCart( geod );
     i.x = cart.x();
     i.y = cart.y();
@@ -153,7 +153,7 @@ operator >> ( istream& in, FGILS& i )
     } else {
        i.has_gs = true;
 
-       geod = Point3D( i.gslon * DEG_TO_RAD, i.gslat * DEG_TO_RAD, i.gselev );
+       geod = Point3D( i.gslon * SGD_DEGREES_TO_RADIANS, i.gslat * SGD_DEGREES_TO_RADIANS, i.gselev );
        cart = sgGeodToCart( geod );
        i.gs_x = cart.x();
        i.gs_y = cart.y();
@@ -166,7 +166,7 @@ operator >> ( istream& in, FGILS& i )
     } else {
        i.has_dme = true;
 
-       geod = Point3D( i.dmelon * DEG_TO_RAD, i.dmelat * DEG_TO_RAD, i.gselev);
+       geod = Point3D( i.dmelon * SGD_DEGREES_TO_RADIANS, i.dmelat * SGD_DEGREES_TO_RADIANS, i.gselev);
        cart = sgGeodToCart( geod );
        i.dme_x = cart.x();
        i.dme_y = cart.y();
index 861e2093fd1aa992b48277cab69f03df9a6ab9c8..181dde50a66f204753521d9e2ecd7df90ef8cc35 100644 (file)
@@ -36,7 +36,7 @@ FGBeacon::FGBeacon( double _lon, double _lat, double _elev,
     elev = _elev;
     type = _type;
 
-    Point3D pos = sgGeodToCart(Point3D(lon * DEG_TO_RAD, lat * DEG_TO_RAD, 0));
+    Point3D pos = sgGeodToCart(Point3D(lon * SGD_DEGREES_TO_RADIANS, lat * SGD_DEGREES_TO_RADIANS, 0));
     // cout << "pos = " << pos << endl;
     x = pos.x();
     y = pos.y();
@@ -160,7 +160,7 @@ FGBeacon::fgMkrBeacType FGMarkerBeacons::query( double lon, double lat,
     beacon_list_iterator current = beacons.begin();
     beacon_list_iterator last = beacons.end();
 
-    Point3D aircraft = sgGeodToCart(Point3D(lon*DEG_TO_RAD, lat*DEG_TO_RAD, 0));
+    Point3D aircraft = sgGeodToCart(Point3D(lon*SGD_DEGREES_TO_RADIANS, lat*SGD_DEGREES_TO_RADIANS, 0));
 
     double min_dist = 999999999.0;
 
index d939e2d013b54e807baeaba8ab4a4658804cf07b..f080a42552a8e87f3c0b92193a11345da1476e74 100644 (file)
@@ -129,9 +129,9 @@ operator >> ( istream& in, FGNav& n )
        // cout << "lat = " << n.lat << " lon = " << n.lon << " elev = " 
        //      << n.elev << " JD = " 
        //      << julian_date << endl;
-       n.magvar = sgGetMagVar(n.lon * DEG_TO_RAD, n.lat * DEG_TO_RAD,
+       n.magvar = sgGetMagVar(n.lon * SGD_DEGREES_TO_RADIANS, n.lat * SGD_DEGREES_TO_RADIANS,
                                n.elev * FEET_TO_METER,
-                               julian_date) * RAD_TO_DEG;
+                               julian_date) * SGD_RADIANS_TO_DEGREES;
        // cout << "Default variation at " << n.lon << ',' << n.lat
        //      << " is " << var << endl;
 #if 0
@@ -156,7 +156,7 @@ operator >> ( istream& in, FGNav& n )
     // cout << n.ident << " " << n.magvar << endl;
 
     // generate cartesian coordinates
-    Point3D geod( n.lon * DEG_TO_RAD, n.lat * DEG_TO_RAD, n.elev );
+    Point3D geod( n.lon * SGD_DEGREES_TO_RADIANS, n.lat * SGD_DEGREES_TO_RADIANS, n.elev );
     Point3D cart = sgGeodToCart( geod );
     n.x = cart.x();
     n.y = cart.y();
index 7f3321be47b6457f9e92ccd2eab1f749cd908643..91f4172ed28a3699923aed5debfdd23e341db97a 100644 (file)
@@ -76,7 +76,7 @@ bool FGAtlas::gen_message() {
             t->getGmt()->tm_hour, t->getGmt()->tm_min, t->getGmt()->tm_sec );
 
     char lat[20];
-    double latd = cur_fdm_state->get_Latitude() * RAD_TO_DEG;
+    double latd = cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
     if ( latd < 0.0 ) {
        latd *= -1.0;
        dir = 'S';
@@ -88,7 +88,7 @@ bool FGAtlas::gen_message() {
     sprintf( lat, "%02d%06.3f,%c", abs(deg), min, dir);
 
     char lon[20];
-    double lond = cur_fdm_state->get_Longitude() * RAD_TO_DEG;
+    double lond = cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
     if ( lond < 0.0 ) {
        lond *= -1.0;
        dir = 'W';
@@ -103,7 +103,7 @@ bool FGAtlas::gen_message() {
     sprintf( speed, "%05.1f", cur_fdm_state->get_V_equiv_kts() );
 
     char heading[10];
-    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * RAD_TO_DEG );
+    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES );
 
     char altitude_m[10];
     sprintf( altitude_m, "%02d", 
@@ -257,7 +257,7 @@ bool FGAtlas::parse_message() {
                lat *= -1;
            }
 
-           cur_fdm_state->set_Latitude( lat * DEG_TO_RAD );
+           cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lat = " << lat );
 
            // lon val
@@ -286,7 +286,7 @@ bool FGAtlas::parse_message() {
                lon *= -1;
            }
 
-           cur_fdm_state->set_Longitude( lon * DEG_TO_RAD );
+           cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lon = " << lon );
 
 #if 0
@@ -323,7 +323,7 @@ bool FGAtlas::parse_message() {
            heading = atof( hdg_str.c_str() );
            cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), 
                                             cur_fdm_state->get_Theta(), 
-                                            heading * DEG_TO_RAD );
+                                            heading * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  heading = " << heading );
        } else if ( sentence == "GPGGA" ) {
            // time
@@ -362,7 +362,7 @@ bool FGAtlas::parse_message() {
                lat *= -1;
            }
 
-           // cur_fdm_state->set_Latitude( lat * DEG_TO_RAD );
+           // cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lat = " << lat );
 
            // lon val
@@ -391,7 +391,7 @@ bool FGAtlas::parse_message() {
                lon *= -1;
            }
 
-           // cur_fdm_state->set_Longitude( lon * DEG_TO_RAD );
+           // cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lon = " << lon );
 
            // junk
index 8c4a3d3da05ff463fe8661ccd1bbf6fb592df685..00a266f47f6496daa6f924f2268372e31ee2ec1c 100644 (file)
@@ -74,7 +74,7 @@ bool FGGarmin::gen_message() {
             t->getGmt()->tm_hour, t->getGmt()->tm_min, t->getGmt()->tm_sec );
 
     char lat[20];
-    double latd = cur_fdm_state->get_Latitude() * RAD_TO_DEG;
+    double latd = cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
     if ( latd < 0.0 ) {
        latd *= -1.0;
        dir = 'S';
@@ -86,7 +86,7 @@ bool FGGarmin::gen_message() {
     sprintf( lat, "%02d%06.3f,%c", abs(deg), min, dir);
 
     char lon[20];
-    double lond = cur_fdm_state->get_Longitude() * RAD_TO_DEG;
+    double lond = cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
     if ( lond < 0.0 ) {
        lond *= -1.0;
        dir = 'W';
@@ -101,7 +101,7 @@ bool FGGarmin::gen_message() {
     sprintf( speed, "%05.1f", cur_fdm_state->get_V_equiv_kts() );
 
     char heading[10];
-    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * RAD_TO_DEG );
+    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES );
 
     char altitude_m[10];
     sprintf( altitude_m, "%02d", 
@@ -236,7 +236,7 @@ bool FGGarmin::parse_message() {
                lat *= -1;
            }
 
-           cur_fdm_state->set_Latitude( lat * DEG_TO_RAD );
+           cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lat = " << lat );
 
            // lon val
@@ -265,7 +265,7 @@ bool FGGarmin::parse_message() {
                lon *= -1;
            }
 
-           cur_fdm_state->set_Longitude( lon * DEG_TO_RAD );
+           cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lon = " << lon );
 
 #if 0
@@ -302,7 +302,7 @@ bool FGGarmin::parse_message() {
            heading = atof( hdg_str.c_str() );
            cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), 
                                             cur_fdm_state->get_Theta(), 
-                                            heading * DEG_TO_RAD );
+                                            heading * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  heading = " << heading );
        } else if ( sentence == "PGRMZ" ) {
            // altitude
index 486dc15513f13c7ae3ac178ebb882e436f283302..68c85a2971c68f94fdec02944a9864fac8d53eab 100644 (file)
@@ -75,7 +75,7 @@ bool FGNMEA::gen_message() {
             t->getGmt()->tm_hour, t->getGmt()->tm_min, t->getGmt()->tm_sec );
 
     char lat[20];
-    double latd = cur_fdm_state->get_Latitude() * RAD_TO_DEG;
+    double latd = cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
     if ( latd < 0.0 ) {
        latd *= -1.0;
        dir = 'S';
@@ -87,7 +87,7 @@ bool FGNMEA::gen_message() {
     sprintf( lat, "%02d%06.3f,%c", abs(deg), min, dir);
 
     char lon[20];
-    double lond = cur_fdm_state->get_Longitude() * RAD_TO_DEG;
+    double lond = cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
     if ( lond < 0.0 ) {
        lond *= -1.0;
        dir = 'W';
@@ -102,7 +102,7 @@ bool FGNMEA::gen_message() {
     sprintf( speed, "%05.1f", cur_fdm_state->get_V_equiv_kts() );
 
     char heading[10];
-    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * RAD_TO_DEG );
+    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES );
 
     char altitude_m[10];
     sprintf( altitude_m, "%02d", 
@@ -241,7 +241,7 @@ bool FGNMEA::parse_message() {
                lat *= -1;
            }
 
-           cur_fdm_state->set_Latitude( lat * DEG_TO_RAD );
+           cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lat = " << lat );
 
            // lon val
@@ -270,7 +270,7 @@ bool FGNMEA::parse_message() {
                lon *= -1;
            }
 
-           cur_fdm_state->set_Longitude( lon * DEG_TO_RAD );
+           cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lon = " << lon );
 
 #if 0
@@ -307,7 +307,7 @@ bool FGNMEA::parse_message() {
            heading = atof( hdg_str.c_str() );
            cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), 
                                             cur_fdm_state->get_Theta(), 
-                                            heading * DEG_TO_RAD );
+                                            heading * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  heading = " << heading );
        } else if ( sentence == "GPGGA" ) {
            // time
@@ -346,7 +346,7 @@ bool FGNMEA::parse_message() {
                lat *= -1;
            }
 
-           // cur_fdm_state->set_Latitude( lat * DEG_TO_RAD );
+           // cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lat = " << lat );
 
            // lon val
@@ -375,7 +375,7 @@ bool FGNMEA::parse_message() {
                lon *= -1;
            }
 
-           // cur_fdm_state->set_Longitude( lon * DEG_TO_RAD );
+           // cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lon = " << lon );
 
            // junk
index f8defdf1a785990fabd5400977e0498bb789da06..6ccc9300a84aaa83ab384b9b87acb09bf34c5144 100644 (file)
@@ -55,7 +55,7 @@ bool FGPVE::gen_message() {
     FGInterface *f = cur_fdm_state;
 
     // get roll and pitch, convert to degrees
-    double roll_deg = f->get_Phi() * RAD_TO_DEG;
+    double roll_deg = f->get_Phi() * SGD_RADIANS_TO_DEGREES;
     while ( roll_deg <= -180.0 ) {
        roll_deg += 360.0;
     }
@@ -63,7 +63,7 @@ bool FGPVE::gen_message() {
        roll_deg -= 360.0;
     }
 
-    double pitch_deg = f->get_Theta() * RAD_TO_DEG;
+    double pitch_deg = f->get_Theta() * SGD_RADIANS_TO_DEGREES;
     while ( pitch_deg <= -180.0 ) {
        pitch_deg += 360.0;
     }
index 73f5c45417f5fcd4b30865059e1a54a7bba24832..815f1150308e4dfba7bc95c52087d5c0a8af24ec 100644 (file)
@@ -61,7 +61,7 @@ bool FGRUL::gen_message() {
     FGInterface *f = cur_fdm_state;
 
     // get roll and pitch, convert to degrees
-    double roll_deg = f->get_Phi() * RAD_TO_DEG;
+    double roll_deg = f->get_Phi() * SGD_RADIANS_TO_DEGREES;
     while ( roll_deg < -180.0 ) {
        roll_deg += 360.0;
     }
@@ -69,7 +69,7 @@ bool FGRUL::gen_message() {
        roll_deg -= 360.0;
     }
 
-    double pitch_deg = f->get_Theta() * RAD_TO_DEG;
+    double pitch_deg = f->get_Theta() * SGD_RADIANS_TO_DEGREES;
     while ( pitch_deg < -180.0 ) {
        pitch_deg += 360.0;
     }
index a8e5204ae30bc8048832c3b15b7248d542788b3c..b417c1d725a40b75d7cfdb788884e1bf823940d4 100644 (file)
@@ -382,8 +382,8 @@ void fgd_send_com( char *FGD_com, char *FGFS_host) {
    speed loss/gain in network-area...
 */
                           get_latitude(), get_longitude(), get_altitude(),
-                          get_speed(), get_roll()*RAD_TO_DEG,
-                          get_pitch()*RAD_TO_DEG, get_heading());
+                          get_speed(), get_roll()*SGD_RADIANS_TO_DEGREES,
+                          get_pitch()*SGD_RADIANS_TO_DEGREES, get_heading());
                  write( sock, fgd_txt, 56);
                  break;
 
index 5f467ca6f73a833247f9889537a8d46086d7a1ef..9f12377f7e34edebf845d95a5dbbb5682ac60b46 100644 (file)
@@ -87,12 +87,12 @@ static Point3D local_calc_tex_coords(const Point3D& node, const Point3D& ref) {
 
     pp = sgCartToPolar3d(cp);
 
-    // tmplon = pp.lon() * RAD_TO_DEG;
-    // tmplat = pp.lat() * RAD_TO_DEG;
+    // tmplon = pp.lon() * SGD_RADIANS_TO_DEGREES;
+    // tmplat = pp.lat() * SGD_RADIANS_TO_DEGREES;
     // cout << tmplon << " " << tmplat << endl;
 
-    pp.setx( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.x(), 11.0) );
-    pp.sety( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.y(), 11.0) );
+    pp.setx( fmod(SGD_RADIANS_TO_DEGREES * FG_TEX_CONSTANT * pp.x(), 11.0) );
+    pp.sety( fmod(SGD_RADIANS_TO_DEGREES * FG_TEX_CONSTANT * pp.y(), 11.0) );
 
     if ( pp.x() < 0.0 ) {
        pp.setx( pp.x() + 11.0 );
@@ -143,7 +143,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) {
     double height = b.get_height();
     double width = b.get_width();
 
-    Point3D center = sgGeodToCart(Point3D(clon*DEG_TO_RAD,clat*DEG_TO_RAD,0.0));
+    Point3D center = sgGeodToCart(Point3D(clon*SGD_DEGREES_TO_RADIANS,clat*SGD_DEGREES_TO_RADIANS,0.0));
     t->center = center;
     // cout << "center = " << center << endl;;
     
@@ -157,7 +157,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) {
     Point3D rad[4];
     int i;
     for ( i = 0; i < 4; ++i ) {
-       rad[i] = Point3D( geod[i].x() * DEG_TO_RAD, geod[i].y() * DEG_TO_RAD,
+       rad[i] = Point3D( geod[i].x() * SGD_DEGREES_TO_RADIANS, geod[i].y() * SGD_DEGREES_TO_RADIANS,
                          geod[i].z() );
     }
 
index 9980cb36c4e9e676fd743b033b1e89b85ea81f50..f55f77db2d8c02353212a5f4b9661992a0b34cfa 100644 (file)
@@ -217,7 +217,7 @@ void FGTileEntry::prep_ssg_node( const Point3D& p, float vis) {
        lights_transform->setTransform( sgTrans );
 
        // select which set of lights based on sun angle
-       float sun_angle = cur_light_params.sun_angle * RAD_TO_DEG;
+       float sun_angle = cur_light_params.sun_angle * SGD_RADIANS_TO_DEGREES;
        if ( sun_angle > 95 ) {
            lights_brightness->select(0x04);
        } else if ( sun_angle > 92 ) {
index 3fa403b3561174b3a352a88f7b79ed1e98739c45..46ddbaca93be6c0a0bba2f85e4e783ff79345143 100644 (file)
@@ -318,8 +318,8 @@ int FGTileMgr::update( double lon, double lat ) {
     // FGInterface *f = current_aircraft.fdm_state;
 
     // lonlat for this update 
-    // longitude = f->get_Longitude() * RAD_TO_DEG;
-    // latitude = f->get_Latitude() * RAD_TO_DEG;
+    // longitude = f->get_Longitude() * SGD_RADIANS_TO_DEGREES;
+    // latitude = f->get_Latitude() * SGD_RADIANS_TO_DEGREES;
     longitude = lon;
     latitude = lat;
     // FG_LOG( FG_TERRAIN, FG_DEBUG, "lon "<< lonlat[LON] <<
@@ -361,8 +361,8 @@ int FGTileMgr::update( double lon, double lat ) {
        sgdVec3 tmp_abs_view_pos;
        sgVec3 tmp_view_pos;
 
-       Point3D geod_pos = Point3D( longitude * DEG_TO_RAD,
-                                   latitude * DEG_TO_RAD,
+       Point3D geod_pos = Point3D( longitude * SGD_DEGREES_TO_RADIANS,
+                                   latitude * SGD_DEGREES_TO_RADIANS,
                                    0.0);
        Point3D tmp = sgGeodToCart( geod_pos );
        scenery.center = tmp;
index be46d20ca43271852a248248a4fc8a28a70801b4..64147ec1b67ba561656865e1f0379e92925b9d56 100644 (file)
@@ -112,7 +112,7 @@ void fgLIGHT::Update( void ) {
     // calculate lighting parameters based on sun's relative angle to
     // local up
 
-    deg = sun_angle * RAD_TO_DEG;
+    deg = sun_angle * SGD_RADIANS_TO_DEGREES;
     FG_LOG( FG_EVENT, FG_INFO, "  Sun angle = " << deg );
 
     ambient = ambient_tbl->interpolate( deg );
@@ -178,12 +178,12 @@ void fgLIGHT::UpdateAdjFog( void ) {
     while ( rotation > SGD_2PI ) {
        rotation -= SGD_2PI;
     }
-    rotation *= RAD_TO_DEG;
+    rotation *= SGD_RADIANS_TO_DEGREES;
     // fgPrintf( FG_EVENT, FG_INFO, 
     //           "  View to sun difference in degrees = %.2f\n", rotation);
 
     // next check if we are in a sunset/sunrise situation
-    sun_angle_deg = sun_angle * RAD_TO_DEG;
+    sun_angle_deg = sun_angle * SGD_RADIANS_TO_DEGREES;
     if ( (sun_angle_deg > 80.0) && (sun_angle_deg < 100.0) ) {
        /* 0.0 - 0.6 */
        param1[0] = (10.0 - fabs(90.0 - sun_angle_deg)) / 20.0;
index f63a32bdd0e719c03d7ec2058bfa872d8d99ef91..3add5d22c9ab44a86e800a5cdef48849f828d94b 100644 (file)
@@ -435,7 +435,7 @@ void fgUpdateMoonPos( void ) {
        l->moon_rotation = -acos(dot);
     }
     // cout << "  Sky needs to rotate = " << angle << " rads = "
-    //      << angle * RAD_TO_DEG << " degrees." << endl;
+    //      << angle * SGD_RADIANS_TO_DEGREES << " degrees." << endl;
 }
 
 
index 3c1c3434f3978ef65d6bddf212b68d6f5d210b87..92b6ab708dffd9dbbde8ceabc5df46b10fb4f09a 100644 (file)
@@ -343,7 +343,7 @@ void fgUpdateSunPos( void ) {
        l->sun_rotation = -acos(dot);
     }
     // cout << "  Sky needs to rotate = " << angle << " rads = "
-    //      << angle * RAD_TO_DEG << " degrees." << endl;
+    //      << angle * SGD_RADIANS_TO_DEGREES << " degrees." << endl;
 }
 
 
index 8dfcfb33b82cc45879cad71823dc3aead117d48b..dfad23e4dd02282e58a0e224737326770043a58d 100644 (file)
@@ -169,6 +169,6 @@ FGPhysicalProperties FGWeatherParse::getFGPhysicalProperties(const unsigned int
 void FGWeatherParse::getPosition(const unsigned int nr, sgVec2 pos) const
 {
     //set the position of the station
-    sgSetVec2( pos, weather_station[nr].lat * DEG_TO_RAD, weather_station[nr].lon * DEG_TO_RAD ); 
+    sgSetVec2( pos, weather_station[nr].lat * SGD_DEGREES_TO_RADIANS, weather_station[nr].lon * SGD_DEGREES_TO_RADIANS ); 
 }
 
index 96fb2c3411a237d8f5ed784d0bfa42bfe5bc5f8c..3aac58306d4de384786c99fbb06a02824ad58074 100644 (file)
@@ -23,10 +23,10 @@ int main() {
        cout << "lon = " << lon << "  geod lat = " << lat;
 
        double sl_radius, lat_geoc;
-       sgGeodToGeoc( lat * DEG_TO_RAD, alt, &sl_radius, &lat_geoc );
-       cout << "  geoc lat = " << lat_geoc * RAD_TO_DEG << endl;
+       sgGeodToGeoc( lat * SGD_DEGREES_TO_RADIANS, alt, &sl_radius, &lat_geoc );
+       cout << "  geoc lat = " << lat_geoc * SGD_RADIANS_TO_DEGREES << endl;
 
-       Point3D pgd( lon * DEG_TO_RAD, lat * DEG_TO_RAD, 0.0 );
+       Point3D pgd( lon * SGD_DEGREES_TO_RADIANS, lat * SGD_DEGREES_TO_RADIANS, 0.0 );
        Point3D pc = sgGeodToCart( pgd );
        cout << "  cartesian = " << pc << endl;
 
@@ -39,7 +39,7 @@ int main() {
 
        sgdMat4 GEOC_UP;
        sgdVec3 geoc_up;
-       sgdMakeRotMat4( GEOC_UP, lon, 0.0, -lat_geoc * RAD_TO_DEG );
+       sgdMakeRotMat4( GEOC_UP, lon, 0.0, -lat_geoc * SGD_RADIANS_TO_DEGREES );
        sgdSetVec3( geoc_up, GEOC_UP[0][0], GEOC_UP[0][1], GEOC_UP[0][2] );
        cout << "  geoc up = " << geoc_up[0] << ", " << geoc_up[1] << ", "
             << geoc_up[2] << endl;