]> git.mxchange.org Git - flightgear.git/commitdiff
FG_ to SG_ namespace changes.
authorcurt <curt>
Sat, 24 Mar 2001 00:18:01 +0000 (00:18 +0000)
committercurt <curt>
Sat, 24 Mar 2001 00:18:01 +0000 (00:18 +0000)
30 files changed:
src/Autopilot/newauto.cxx
src/Cockpit/cockpit.cxx
src/Cockpit/hud_ladr.cxx
src/Cockpit/hud_tbi.cxx
src/Cockpit/radiostack.cxx
src/FDM/Balloon/BalloonSim.cpp
src/FDM/JSBSim/FGDefs.h
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTrim.cpp
src/FDM/LaRCsim.cxx
src/FDM/MagicCarpet.cxx
src/GUI/mouse.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/ilslist.cxx
src/Navaids/mkrbeacons.cxx
src/Network/ray.cxx
src/Scenery/hitlist.cxx
src/Sound/morse.cxx
src/Time/light.cxx
src/Time/moonpos.cxx
src/Time/sunpos.cxx

index 99bf553c1c182fc33b063c39f83f4bfc48e754a4..f0b3bfbb2b7ec0c1b0806d0f391ea768ef8445f4 100644 (file)
@@ -321,7 +321,7 @@ static double LinearExtrapolate( double x, double x1, double y1, double x2, doub
        // Could be
        // static double y = 0.0;
        // double dx = x2 -x1;
-       // if( (dx < -FG_EPSILON ) || ( dx > FG_EPSILON ) )
+       // if( (dx < -SG_EPSILON ) || ( dx > SG_EPSILON ) )
        // {
 
     double m, b, y;          // the constants to find in y=mx+b
@@ -955,13 +955,13 @@ void FGAutopilot::AltitudeAdjust( double inc )
     // cout << "target_agl / inc = " << target_agl / inc << endl;
     // cout << "(int)(target_agl / inc) = " << (int)(target_agl / inc) << endl;
 
-    if ( fabs((int)(target_alt / inc) * inc - target_alt) < FG_EPSILON ) {
+    if ( fabs((int)(target_alt / inc) * inc - target_alt) < SG_EPSILON ) {
        target_alt += inc;
     } else {
        target_alt = ( int ) ( target_alt / inc ) * inc + inc;
     }
 
-    if ( fabs((int)(target_agl / inc) * inc - target_agl) < FG_EPSILON ) {
+    if ( fabs((int)(target_agl / inc) * inc - target_agl) < SG_EPSILON ) {
        target_agl += inc;
     } else {
        target_agl = ( int ) ( target_agl / inc ) * inc + inc;
index 81f40ddb9060dee026df286c34df5ff55f63f53f..9ffee6e009ea404dc8370657caa7b7d0bb0fe892 100644 (file)
@@ -274,7 +274,7 @@ float get_climb_rate( void )
 
 float get_view_direction( void )
 {
-    double view_off = FG_2PI - globals->get_current_view()->get_view_offset();
+    double view_off = SG_2PI - globals->get_current_view()->get_view_offset();
     double view = ( current_aircraft.fdm_state->get_Psi() + view_off)
        * RAD_TO_DEG;
     
index 2e9524ac380205e879d2eeea612e711ec2d9e08c..2ef45b6075d5600597ee5847c86ef3a7f5fb6775 100644 (file)
@@ -276,8 +276,8 @@ void HudLadder :: draw( void )
        //  velocity vector
        glBegin(GL_LINE_LOOP);  // Use polygon to approximate a circle 
         for(count=0; count<50; count++) {             
-           cosine = 6 * cos(count * 2 * FG_PI/50.0); 
-            sine =   6 * sin(count * 2 * FG_PI/50.0); 
+           cosine = 6 * cos(count * 2 * SG_PI/50.0); 
+            sine =   6 * sin(count * 2 * SG_PI/50.0); 
             glVertex2f(cosine+vel_x, sine+vel_y);
        }     
        glEnd(); 
index 25968b56335ef894d2d1bcf3fcdd0e8923b26dfb..25db5111c35fb0b2426f1f713d441f86ea9a3f03 100644 (file)
@@ -68,18 +68,18 @@ operator = (const fgTBI_instr & rhs )
 
      bank_angle     = current_ch2();  // Roll limit +/- 30 degrees
      
-     if( bank_angle < -FG_PI_2/3 ) {
-         bank_angle = -FG_PI_2/3;
-     } else if( bank_angle > FG_PI_2/3 ) {
-             bank_angle = FG_PI_2/3;
+     if( bank_angle < -SG_PI_2/3 ) {
+         bank_angle = -SG_PI_2/3;
+     } else if( bank_angle > SG_PI_2/3 ) {
+             bank_angle = SG_PI_2/3;
      }
      
      sideslip_angle = current_ch1(); // Sideslip limit +/- 20 degrees
      
-     if( sideslip_angle < -FG_PI/9 ) {
-         sideslip_angle = -FG_PI/9;
-     } else if( sideslip_angle > FG_PI/9 ) {
-             sideslip_angle = FG_PI/9;
+     if( sideslip_angle < -SG_PI/9 ) {
+         sideslip_angle = -SG_PI/9;
+     } else if( sideslip_angle > SG_PI/9 ) {
+             sideslip_angle = SG_PI/9;
      }
 
      cen_x = centroid.x;
@@ -88,7 +88,7 @@ operator = (const fgTBI_instr & rhs )
      tee   = -tee_height;
      fspan = span;
      hole  = scr_hole;
-     ss_const = 2 * sideslip_angle * fspan/(FG_2PI/9);  // width represents 40 degrees
+     ss_const = 2 * sideslip_angle * fspan/(SG_2PI/9);  // width represents 40 degrees
      
 //   printf("side_slip: %f   fspan: %f\n", sideslip_angle, fspan);
 //   printf("ss_const: %f   hole: %f\n", ss_const, hole);
index ae038231566fb30c10d38dc8a8a7dd9330ae1460..81c753a47569342801171d5c89299c2c7ff41a25 100644 (file)
@@ -253,10 +253,10 @@ double FGRadioStack::adjustNavRange( double stationElev, double aircraftElev,
     // cout << "aircraft elev = " << aircraftElev * METER_TO_FEET
     //      << " station elev = " << stationElev << endl;
 
-    if ( nominalRange < 25.0 + FG_EPSILON ) {
+    if ( nominalRange < 25.0 + SG_EPSILON ) {
        // Standard Terminal Service Volume
        return term_tbl->interpolate( alt ) * usability_factor;
-    } else if ( nominalRange < 50.0 + FG_EPSILON ) {
+    } else if ( nominalRange < 50.0 + SG_EPSILON ) {
        // Standard Low Altitude Service Volume
        // table is based on range of 40, scale to actual range
        return low_tbl->interpolate( alt ) * nominalRange / 40.0
index 88dd3a691b9fc2fe8e0b10f2bb592f735943af1f..697fcd62b379d28c0c503e9e27b15d331a1ec6d7 100644 (file)
@@ -78,10 +78,10 @@ balloon::balloon()
     /* size for hot air balloons                                           */
     /************************************************************************/
 
-    balloon_envelope_area = 4.0 * (8.8 * 8.8) * FG_PI; 
-    balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * FG_PI;
+    balloon_envelope_area = 4.0 * (8.8 * 8.8) * SG_PI; 
+    balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * SG_PI;
 
-    wind_facing_area_of_balloon = FG_PI * (8.8 * 8.8);
+    wind_facing_area_of_balloon = SG_PI * (8.8 * 8.8);
     wind_facing_area_of_basket = 2.0;  //guessed: 2 m^2
     
     cw_envelope=0.45;                  //a sphere in this case
index 132b7470a52230a2d85bb2f1797119a37d8e606f..1f0aa12ab51b96ef20e7431972bdc503d51d4506 100644 (file)
@@ -69,7 +69,7 @@ enum eParam {
   FG_ALPHADOT,
   FG_BETA,
   FG_BETADOT,
-  FG_PITCHRATE,
+  SG_PITCHRATE,
   FG_ROLLRATE,
   FG_YAWRATE,
   FG_MACH,
@@ -91,7 +91,7 @@ enum eParam {
   FG_THROTTLE_CMD,
   FG_THROTTLE_POS,
   FG_HOVERB,
-  FG_PITCH_TRIM_CMD
+  SG_PITCH_TRIM_CMD
 };
 
 /******************************************************************************/
index f09b12591ba0edc6a1fa04c0ac217a82014bc464..c9d033c7e2e9061f8b7c81718ad53aa891805c53 100644 (file)
@@ -89,7 +89,7 @@ CLASS DOCUMENTATION
     &lt COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER"&gt
       ID            0
       INPUT        FG_ELEVATOR_CMD
-      INPUT        FG_PITCH_TRIM_CMD
+      INPUT        SG_PITCH_TRIM_CMD
       CLIPTO       -1 1
     &lt/COMPONENT&gt
 
index b33f7764210484a3c4226abc495c423e5283fdf8..26e1d372ba0454dc5d342d9bac599e00be8ef742 100644 (file)
@@ -69,7 +69,7 @@ INCLUDES
 
 #ifndef M_PI
 #  include <simgear/constants.h>
-#  define M_PI FG_PI
+#  define M_PI SG_PI
 #endif
 
 #include "FGModel.h"
index ec183c13cbabf074b0a942a8a1504cd7b86cff9f..06284619512d368fc44aa0d029391900b1478d5d 100644 (file)
@@ -49,7 +49,7 @@ INCLUDES
 
 #ifndef M_PI 
 #  include <simgear/constants.h>
-#  define M_PI FG_PI
+#  define M_PI SG_PI
 #endif
 
 #include "FGState.h"
@@ -102,7 +102,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3),
   RegisterVariable(FG_ALPHADOT,       " alphadot "       );
   RegisterVariable(FG_BETA,           " beta "           );
   RegisterVariable(FG_BETADOT,        " betadot "        );
-  RegisterVariable(FG_PITCHRATE,      " pitch_rate "     );
+  RegisterVariable(SG_PITCHRATE,      " pitch_rate "     );
   RegisterVariable(FG_ROLLRATE,       " roll_rate "      );
   RegisterVariable(FG_YAWRATE,        " yaw_rate "       );
   RegisterVariable(FG_MACH,           " mach "           );
@@ -124,7 +124,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3),
   RegisterVariable(FG_THROTTLE_CMD,   " throttle_cmd "   );
   RegisterVariable(FG_THROTTLE_POS,   " throttle_pos "   );
   RegisterVariable(FG_HOVERB,         " height/span "    );
-  RegisterVariable(FG_PITCH_TRIM_CMD, " pitch_trim_cmd " );
+  RegisterVariable(SG_PITCH_TRIM_CMD, " pitch_trim_cmd " );
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -151,7 +151,7 @@ float FGState::GetParameter(eParam val_idx) {
     return FDMExec->GetTranslation()->Getbeta();
   case FG_BETADOT:
     return FDMExec->GetTranslation()->Getbdot();
-  case FG_PITCHRATE:
+  case SG_PITCHRATE:
     return (FDMExec->GetRotation()->GetPQR())(2);
   case FG_ROLLRATE:
     return (FDMExec->GetRotation()->GetPQR())(1);
@@ -201,7 +201,7 @@ float FGState::GetParameter(eParam val_idx) {
     return FDMExec->GetFCS()->GetThrottlePos(0);
   case FG_HOVERB:
     return FDMExec->GetPosition()->GetHOverB();
-  case FG_PITCH_TRIM_CMD:
+  case SG_PITCH_TRIM_CMD:
     return FDMExec->GetFCS()->GetPitchTrimCmd();
   default:
     cerr << "FGState::GetParameter() - No handler for parameter " << val_idx << endl;
index 5c2bf2d524da7edd966e54660cd8b8f5490fad13..8583bdf1ef44e3fb1e54778c1070f84fbae1fa0a 100644 (file)
@@ -189,7 +189,7 @@ void FGTrim::ReportState(void) {
   cout << out;                  
   sprintf(out, "    Normal Load Factor: %4.2f g's  Pitch Rate: %5.2f deg/s\n",
                     fdmex->GetAircraft()->GetNlf(),
-                    fdmex->GetState()->GetParameter(FG_PITCHRATE)*RADTODEG );
+                    fdmex->GetState()->GetParameter(SG_PITCHRATE)*RADTODEG );
   cout << out;
   sprintf(out, "    Heading: %3.0f deg true  Sideslip: %5.2f deg\n",
                     fdmex->GetRotation()->Getpsi()*RADTODEG,
index 09e1933814b947b37694dd8f8268c84f2222efb3..d4975bf2c0a104a8774d843f93c79eb1fbaad7f1 100644 (file)
@@ -474,12 +474,12 @@ bool FGLaRCsim::copy_from_LaRCsim() {
            << " radius_to_vehicle = " << Radius_to_vehicle );
 
     double tmp_lon_geoc = Lon_geocentric;
-    while ( tmp_lon_geoc < -FG_PI ) { tmp_lon_geoc += FG_2PI; }
-    while ( tmp_lon_geoc > FG_PI ) { tmp_lon_geoc -= FG_2PI; }
+    while ( tmp_lon_geoc < -SG_PI ) { tmp_lon_geoc += SG_2PI; }
+    while ( tmp_lon_geoc > SG_PI ) { tmp_lon_geoc -= SG_2PI; }
 
     double tmp_lon = Longitude;
-    while ( tmp_lon < -FG_PI ) { tmp_lon += FG_2PI; }
-    while ( tmp_lon > FG_PI ) { tmp_lon -= FG_2PI; }
+    while ( tmp_lon < -SG_PI ) { tmp_lon += SG_2PI; }
+    while ( tmp_lon > SG_PI ) { tmp_lon -= SG_2PI; }
 
     // Positions
     _set_Geocentric_Position( Lat_geocentric, tmp_lon_geoc, 
index 0e8f8b308fe75c1d580d0955b3914b1aa48e2ddd..01c82a079e2d4f727d9a3836e7210917baf03447 100644 (file)
@@ -62,16 +62,16 @@ bool FGMagicCarpet::update( int multiloop ) {
     _set_V_ground_speed( kts );
 
     // angle of turn
-    double turn_rate = controls.get_aileron() * FG_PI_4; // radians/sec
+    double turn_rate = controls.get_aileron() * SG_PI_4; // radians/sec
     double turn = turn_rate * time_step;
 
     // update euler angles
-    _set_Euler_Angles( get_Phi(), get_Theta(), fmod(get_Psi() + turn, FG_2PI) );
+    _set_Euler_Angles( get_Phi(), get_Theta(), fmod(get_Psi() + turn, SG_2PI) );
     _set_Euler_Rates(0,0,0);
 
     // update (lon/lat) position
     double lat2, lon2, az2;
-    if ( speed > FG_EPSILON ) {
+    if ( speed > SG_EPSILON ) {
        geo_direct_wgs_84 ( get_Altitude(),
                            get_Latitude() * RAD_TO_DEG,
                            get_Longitude() * RAD_TO_DEG,
index 3feca5e61a2a32ae318e06009956e01e717fc8f9..1c28a46aa62b419dff48a58c88cd78bbc3d7f2c8 100644 (file)
@@ -349,7 +349,7 @@ void guiMotionFunc ( int x, int y )
                     need_warp = 1;
                     x = 1;
                 }
-                // try to get FG_PI movement in each half of screen
+                // try to get SG_PI movement in each half of screen
                 // do spherical pan
                 W = ww;
                 H = wh;
@@ -378,12 +378,12 @@ void guiMotionFunc ( int x, int y )
                 // this could be done in above quat
                 // but requires redoing view pipeline
                 offset = globals->get_current_view()->get_goal_view_offset();
-                offset += ((_mX - x) * FG_2PI / W );
+                offset += ((_mX - x) * SG_2PI / W );
                 while (offset < 0.0) {
-                    offset += FG_2PI;
+                    offset += SG_2PI;
                 }
-                while (offset > FG_2PI) {
-                    offset -= FG_2PI;
+                while (offset > SG_2PI) {
+                    offset -= SG_2PI;
                 }
                 globals->get_current_view()->set_goal_view_offset(offset);
 #ifdef NO_SMOOTH_MOUSE_VIEW
index 41f886e25688cea0b830e697d831ad8cacb60b4b..e37b307dd0cd1fabb23dcda664cead01d96bca96 100644 (file)
@@ -377,12 +377,12 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) {
                        azimuth, found_r.length * FEET_TO_METER * 0.5 - 5.0,
                        &lat2, &lon2, &az2 );
 
-    if ( fabs( fgGetDouble("/sim/startup/offset-distance") ) > FG_EPSILON ) {
+    if ( fabs( fgGetDouble("/sim/startup/offset-distance") ) > SG_EPSILON ) {
        double olat, olon;
        double odist = fgGetDouble("/sim/startup/offset-distance");
        odist *= NM_TO_METER;
        double oaz = azimuth;
-       if ( fabs(fgGetDouble("/sim/startup/offset-azimuth")) > FG_EPSILON ) {
+       if ( fabs(fgGetDouble("/sim/startup/offset-azimuth")) > SG_EPSILON ) {
            oaz = fgGetDouble("/sim/startup/offset-azimuth") + 180;
        }
        while ( oaz >= 360.0 ) { oaz -= 360.0; }
index b7a994c85c35922a7a74d813c2cf7426aee0ee2a..6b5d950540b1455777abb345b9d00ac3952726a1 100644 (file)
@@ -152,28 +152,28 @@ void GLUTkey(unsigned char k, int x, int y) {
            }
            return;
        case 49: // numeric keypad 1
-           v->set_goal_view_offset( FG_PI * 0.75 );
+           v->set_goal_view_offset( SG_PI * 0.75 );
            return;
        case 50: // numeric keypad 2
-           v->set_goal_view_offset( FG_PI );
+           v->set_goal_view_offset( SG_PI );
            return;
        case 51: // numeric keypad 3
-           v->set_goal_view_offset( FG_PI * 1.25 );
+           v->set_goal_view_offset( SG_PI * 1.25 );
            return;
        case 52: // numeric keypad 4
-           v->set_goal_view_offset( FG_PI * 0.50 );
+           v->set_goal_view_offset( SG_PI * 0.50 );
            return;
        case 54: // numeric keypad 6
-           v->set_goal_view_offset( FG_PI * 1.50 );
+           v->set_goal_view_offset( SG_PI * 1.50 );
            return;
        case 55: // numeric keypad 7
-           v->set_goal_view_offset( FG_PI * 0.25 );
+           v->set_goal_view_offset( SG_PI * 0.25 );
            return;
        case 56: // numeric keypad 8
            v->set_goal_view_offset( 0.00 );
            return;
        case 57: // numeric keypad 9
-           v->set_goal_view_offset( FG_PI * 1.75 );
+           v->set_goal_view_offset( SG_PI * 1.75 );
            return;
        case 65: // A key
            speed = fgGetInt("/sim/speed-up");
@@ -497,28 +497,28 @@ void GLUTspecialkey(int k, int x, int y) {
          return;
        }
        case GLUT_KEY_END: // numeric keypad 1
-           v->set_goal_view_offset( FG_PI * 0.75 );
+           v->set_goal_view_offset( SG_PI * 0.75 );
            return;
        case GLUT_KEY_DOWN: // numeric keypad 2
-           v->set_goal_view_offset( FG_PI );
+           v->set_goal_view_offset( SG_PI );
            return;
        case GLUT_KEY_PAGE_DOWN: // numeric keypad 3
-           v->set_goal_view_offset( FG_PI * 1.25 );
+           v->set_goal_view_offset( SG_PI * 1.25 );
            return;
        case GLUT_KEY_LEFT: // numeric keypad 4
-           v->set_goal_view_offset( FG_PI * 0.50 );
+           v->set_goal_view_offset( SG_PI * 0.50 );
            return;
        case GLUT_KEY_RIGHT: // numeric keypad 6
-           v->set_goal_view_offset( FG_PI * 1.50 );
+           v->set_goal_view_offset( SG_PI * 1.50 );
            return;
        case GLUT_KEY_HOME: // numeric keypad 7
-           v->set_goal_view_offset( FG_PI * 0.25 );
+           v->set_goal_view_offset( SG_PI * 0.25 );
            return;
        case GLUT_KEY_UP: // numeric keypad 8
            v->set_goal_view_offset( 0.00 );
            return;
        case GLUT_KEY_PAGE_UP: // numeric keypad 9
-           v->set_goal_view_offset( FG_PI * 1.75 );
+           v->set_goal_view_offset( SG_PI * 1.75 );
            return;
        }
     } else {
index 196619393aa8c7422a0d59862e96861990fcedcb..ea9caccaf830cefbb5a01c175c0c09b851057bbd 100644 (file)
@@ -802,38 +802,38 @@ void fgUpdateTimeDepCalcs() {
            // current_view.goal_view_offset
            if ( v->get_goal_view_offset() > v->get_view_offset() )
             {
-               if ( v->get_goal_view_offset() - v->get_view_offset() < FG_PI ){
+               if ( v->get_goal_view_offset() - v->get_view_offset() < SG_PI ){
                    v->inc_view_offset( 0.01 );
                } else {
                    v->inc_view_offset( -0.01 );
                }
            } else {
-               if ( v->get_view_offset() - v->get_goal_view_offset() < FG_PI ){
+               if ( v->get_view_offset() - v->get_goal_view_offset() < SG_PI ){
                    v->inc_view_offset( -0.01 );
                } else {
                    v->inc_view_offset( 0.01 );
                }
            }
-           if ( v->get_view_offset() > FG_2PI ) {
-               v->inc_view_offset( -FG_2PI );
+           if ( v->get_view_offset() > SG_2PI ) {
+               v->inc_view_offset( -SG_2PI );
            } else if ( v->get_view_offset() < 0 ) {
-               v->inc_view_offset( FG_2PI );
+               v->inc_view_offset( SG_2PI );
            }
        }
     }
 
-    double tmp = -(l->sun_rotation + FG_PI) 
+    double tmp = -(l->sun_rotation + SG_PI) 
        - (cur_fdm_state->get_Psi() -
           globals->get_current_view()->get_view_offset() );
     while ( tmp < 0.0 ) {
-       tmp += FG_2PI;
+       tmp += SG_2PI;
     }
-    while ( tmp > FG_2PI ) {
-       tmp -= FG_2PI;
+    while ( tmp > SG_2PI ) {
+       tmp -= SG_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+FG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
+          -(l->sun_rotation+SG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
     l->UpdateAdjFog();
 
     // Update solar system
index 299e1e06ad03ac469093041153e1c2d5b3dac30e..959f64c7bf642d6f7564a174759516d5bde16a95 100644 (file)
@@ -820,9 +820,9 @@ parse_option (const string& arg)
        string woffset = arg.substr( 14 );
        double default_view_offset = 0.0;
        if ( woffset == "LEFT" ) {
-              default_view_offset = FG_PI * 0.25;
+              default_view_offset = SG_PI * 0.25;
        } else if ( woffset == "RIGHT" ) {
-           default_view_offset = FG_PI * 1.75;
+           default_view_offset = SG_PI * 1.75;
        } else if ( woffset == "CENTER" ) {
            default_view_offset = 0.00;
        } else {
index 7dc778b30dff085338751ac68f5c5e5046403bff..9518bc01927f0f3813c10cadcd09eca9c49c802b 100644 (file)
@@ -33,7 +33,7 @@ main() {
 
     // Yaw Matrix
     MAT3_SET_HVEC(vec, 0.0, -1.0, 0.0, 1.0);
-    MAT3rotate(R_Psi, vec, FG_PI + FG_Psi);
+    MAT3rotate(R_Psi, vec, SG_PI + FG_Psi);
     printf("\nYaw matrix (Psi)\n");
     MAT3print(R_Psi, stdout);
 
@@ -47,7 +47,7 @@ main() {
     // Longitude
     MAT3_SET_HVEC(vec, 0.0, 0.0, 1.0, 1.0);
     // R_Lon = rotate about Z axis
-    MAT3rotate(R_Lon, vec, FG_Longitude - FG_PI_2 );
+    MAT3rotate(R_Lon, vec, FG_Longitude - SG_PI_2 );
     printf("\nLongitude matrix\n");
     MAT3print(R_Lon, stdout);
 
index 82c35cce87bed2ba50640c7b8f554083df4e6746..511bded4343d45f122631dc133ccc849cf46e80d 100644 (file)
@@ -200,7 +200,7 @@ void FGViewerLookAt::update() {
     sgNegateVec3(world_down, world_up);
     sgVectorProductVec3(surface_east, surface_south, world_down);
 #else
-    sgMakeRotMat4( TMP, FG_PI_2 * RAD_TO_DEG, world_up );
+    sgMakeRotMat4( TMP, SG_PI_2 * RAD_TO_DEG, world_up );
     // cout << "sgMat4 TMP" << endl;
     // print_sgMat4( TMP );
     sgXformVec3(surface_east, surface_south, TMP);
index 53128e7ff1387b5cc939d6c15663bc194c97b858..83db4916fa2c3cb63c89844f3f3e0bdc6952f2a8 100644 (file)
@@ -326,7 +326,7 @@ void FGViewerRPH::update() {
     sgNegateVec3(world_down, world_up);
     sgVectorProductVec3(surface_east, surface_south, world_down);
 #else
-    sgMakeRotMat4( TMP, FG_PI_2 * RAD_TO_DEG, world_up );
+    sgMakeRotMat4( TMP, SG_PI_2 * RAD_TO_DEG, world_up );
     // cout << "sgMat4 TMP" << endl;
     // print_sgMat4( TMP );
     sgXformVec3(surface_east, surface_south, TMP);
index a94d8ceb07b05eb1a1bb273f80c46b65d2c35682..37fd9fd5b2f712379a4a476f765e1df60f816077 100644 (file)
@@ -148,7 +148,7 @@ operator >> ( istream& in, FGILS& i )
     i.y = cart.y();
     i.z = cart.z();
 
-    if ( i.gslon < FG_EPSILON && i.gslat < FG_EPSILON ) {
+    if ( i.gslon < SG_EPSILON && i.gslat < SG_EPSILON ) {
        i.has_gs = false;
     } else {
        i.has_gs = true;
@@ -161,7 +161,7 @@ operator >> ( istream& in, FGILS& i )
        // cout << "gs = " << cart << endl;
     }
 
-    if ( i.dmelon < FG_EPSILON && i.dmelat < FG_EPSILON ) {
+    if ( i.dmelon < SG_EPSILON && i.dmelat < SG_EPSILON ) {
        i.has_dme = false;
     } else {
        i.has_dme = true;
index 318b3f05593614dad4065c51ce7add14a3fe74a5..e11112afa225cde6d19bc905bbf7db81d55b6015 100644 (file)
@@ -98,18 +98,18 @@ bool FGILSList::init( FGPath path ) {
        }
 
        // update the marker beacon list
-       if ( fabs(ils.get_omlon()) > FG_EPSILON ||
-            fabs(ils.get_omlat()) > FG_EPSILON ) {
+       if ( fabs(ils.get_omlon()) > SG_EPSILON ||
+            fabs(ils.get_omlat()) > SG_EPSILON ) {
            current_beacons->add( ils.get_omlon(), ils.get_omlat(),
                                  ils.get_gselev(), FGBeacon::OUTER );
        }
-       if ( fabs(ils.get_mmlon()) > FG_EPSILON ||
-            fabs(ils.get_mmlat()) > FG_EPSILON ) {
+       if ( fabs(ils.get_mmlon()) > SG_EPSILON ||
+            fabs(ils.get_mmlat()) > SG_EPSILON ) {
            current_beacons->add( ils.get_mmlon(), ils.get_mmlat(),
                                  ils.get_gselev(), FGBeacon::MIDDLE );
        }
-       if ( fabs(ils.get_imlon()) > FG_EPSILON ||
-            fabs(ils.get_imlat()) > FG_EPSILON ) {
+       if ( fabs(ils.get_imlon()) > SG_EPSILON ||
+            fabs(ils.get_imlat()) > SG_EPSILON ) {
            current_beacons->add( ils.get_imlon(), ils.get_imlat(),
                                  ils.get_gselev(), FGBeacon::INNER );
        }
index 6c4da70ed323b032ba4b4bc40b955c8a03007c3f..861e2093fd1aa992b48277cab69f03df9a6ab9c8 100644 (file)
@@ -82,7 +82,7 @@ bool FGMarkerBeacons::add( double lon, double lat, double elev,
 
     int lonidx = (int)lon;
     diff = lon - (double)lonidx;
-    if ( (lon < 0.0) && (fabs(diff) > FG_EPSILON) ) {
+    if ( (lon < 0.0) && (fabs(diff) > SG_EPSILON) ) {
        lonidx -= 1;
     }
     double lonfrac = lon - (double)lonidx;
@@ -90,7 +90,7 @@ bool FGMarkerBeacons::add( double lon, double lat, double elev,
 
     int latidx = (int)lat;
     diff = lat - (double)latidx;
-    if ( (lat < 0.0) && (fabs(diff) > FG_EPSILON) ) {
+    if ( (lat < 0.0) && (fabs(diff) > SG_EPSILON) ) {
        latidx -= 1;
     }
     double latfrac = lat - (double)latidx;
@@ -139,14 +139,14 @@ FGBeacon::fgMkrBeacType FGMarkerBeacons::query( double lon, double lat,
 
     int lonidx = (int)lon;
     diff = lon - (double)lonidx;
-    if ( (lon < 0.0) && (fabs(diff) > FG_EPSILON) ) {
+    if ( (lon < 0.0) && (fabs(diff) > SG_EPSILON) ) {
        lonidx -= 1;
     }
     lonidx += 180;
 
     int latidx = (int)lat;
     diff = lat - (double)latidx;
-    if ( (lat < 0.0) && (fabs(diff) > FG_EPSILON) ) {
+    if ( (lat < 0.0) && (fabs(diff) > SG_EPSILON) ) {
        latidx -= 1;
     }
     latidx += 90;
index 4f8d1c473a0e33a91183d648573998841833b472..2644e705789427c480d68d7cd38a6503c68548bd 100644 (file)
@@ -104,11 +104,11 @@ bool FGRAY::gen_message() {
        /* Make sure the angles are reasonable onscale */
        /* We use an asymmetric mapping so that the chair behaves
           reasonably when upside down.  Otherwise it oscillates. */
-       while ( ang_pos < -2*FG_PI/3 ) {
-               ang_pos += 2 * FG_PI;
+       while ( ang_pos < -2*SG_PI/3 ) {
+               ang_pos += 2 * SG_PI;
        }
-       while ( ang_pos >  4*FG_PI/3 ) {
-               ang_pos -= 2 * FG_PI;
+       while ( ang_pos >  4*SG_PI/3 ) {
+               ang_pos -= 2 * SG_PI;
        }
 
        /* Tell interested parties what the situation is */
@@ -131,11 +131,11 @@ bool FGRAY::gen_message() {
 
        /* yaw */
                /* Make sure that we walk through North cleanly */
-               if ( fabs ( ang_pos - chair_heading ) > FG_PI )
+               if ( fabs ( ang_pos - chair_heading ) > SG_PI )
                {       /* Need to swing chair by 360 degrees */
                        if ( ang_pos < chair_heading )
-                               chair_heading -= 2 * FG_PI;
-                       else    chair_heading += 2 * FG_PI;
+                               chair_heading -= 2 * SG_PI;
+                       else    chair_heading += 2 * SG_PI;
                }
                /* Remove the chair heading from the true heading */
                ang_pos -= chair_heading;
@@ -144,7 +144,7 @@ bool FGRAY::gen_message() {
                   can just about represent 30 degrees full scale.  */
                chair_heading += ang_pos * dt * 0.2;
                /* If they turn fast, at 90 deg error subtract 30 deg */
-               if ( fabs(ang_pos) > FG_PI / 2 )
+               if ( fabs(ang_pos) > SG_PI / 2 )
                        chair_heading += ang_pos / 3;
 
        } else
@@ -178,8 +178,8 @@ bool FGRAY::gen_message() {
                /* Scale to the hardware's full scale range */
                propose /= fullscale [ subaxis ];
                /* Use a sine shaped washout on all axes */
-               if ( propose < -FG_PI / 2 ) *dac = 0x0000; else
-               if ( propose >  FG_PI / 2 ) *dac = 0xFFFF; else
+               if ( propose < -SG_PI / 2 ) *dac = 0x0000; else
+               if ( propose >  SG_PI / 2 ) *dac = 0xFFFF; else
                   *dac = (unsigned short) ( 32767 * 
                                ( 1.0 + sin ( propose ) ) );
        }
index 8ed9a0dfcbaddf5ee3b15d8df7bb04e8f9346d2b..31dc508a7e470632848ef412642514c4f098129b 100644 (file)
@@ -53,7 +53,7 @@ static bool sgdPointInTriangle( sgdVec3 point, sgdVec3 tri[3] )
     //first, drop the smallest dimension so we only have to work
     //in 2d.
     double x1, y1, x2, y2, x3, y3, rx, ry;
-    if ( fabs(min_dim-dx) <= FG_EPSILON ) {
+    if ( fabs(min_dim-dx) <= SG_EPSILON ) {
         // x is the smallest dimension
         x1 = point[1];
         y1 = point[2];
@@ -63,7 +63,7 @@ static bool sgdPointInTriangle( sgdVec3 point, sgdVec3 tri[3] )
         y3 = tri[1][2];
         rx = tri[2][1];
         ry = tri[2][2];
-    } else if ( fabs(min_dim-dy) <= FG_EPSILON ) {
+    } else if ( fabs(min_dim-dy) <= SG_EPSILON ) {
         // y is the smallest dimension
         x1 = point[0];
         y1 = point[2];
@@ -73,7 +73,7 @@ static bool sgdPointInTriangle( sgdVec3 point, sgdVec3 tri[3] )
         y3 = tri[1][2];
         rx = tri[2][0];
         ry = tri[2][2];
-    } else if ( fabs(min_dim-dz) <= FG_EPSILON ) {
+    } else if ( fabs(min_dim-dz) <= SG_EPSILON ) {
         // z is the smallest dimension
         x1 = point[0];
         y1 = point[1];
index 6516eb5ff1bbc80d18a1939d2471d25b7c4e49ca..0e134fbf5f031db584b99059d95dbda30f0b3a7b 100644 (file)
@@ -71,7 +71,7 @@ bool FGMorse::init() {
 
     // Make Low DIT
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                              / (8000.0 / LO_FREQUENCY) ) )
            * ((double)i / TRANSITION_BYTES)
            / 2.0 + 0.5;
@@ -82,7 +82,7 @@ bool FGMorse::init() {
 
     for ( i = TRANSITION_BYTES;
          i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -93,7 +93,7 @@ bool FGMorse::init() {
     for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DIT_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -107,7 +107,7 @@ bool FGMorse::init() {
 
     // Make High DIT
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / HI_FREQUENCY)) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
@@ -117,7 +117,7 @@ bool FGMorse::init() {
 
     for ( i = TRANSITION_BYTES;
          i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -128,7 +128,7 @@ bool FGMorse::init() {
     for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DIT_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -142,7 +142,7 @@ bool FGMorse::init() {
 
     // Make Low DAH
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
@@ -153,7 +153,7 @@ bool FGMorse::init() {
     for ( i = TRANSITION_BYTES;
          i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -164,7 +164,7 @@ bool FGMorse::init() {
     for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DAH_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -178,7 +178,7 @@ bool FGMorse::init() {
 
     // Make High DAH
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
@@ -189,7 +189,7 @@ bool FGMorse::init() {
     for ( i = TRANSITION_BYTES;
          i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -200,7 +200,7 @@ bool FGMorse::init() {
     for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DAH_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI
+       float level = ( sin( (double) i * 2.0 * SG_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -227,7 +227,7 @@ bool FGMorse::cust_init(const int freq ) {
 
     // Make DIT
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI / (8000.0 / freq)) )
+       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq)) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -236,7 +236,7 @@ bool FGMorse::cust_init(const int freq ) {
 
     for ( i = TRANSITION_BYTES;
          i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
            / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -246,7 +246,7 @@ bool FGMorse::cust_init(const int freq ) {
     for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DIT_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
 
@@ -259,7 +259,7 @@ bool FGMorse::cust_init(const int freq ) {
 
     // Make DAH
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -269,7 +269,7 @@ bool FGMorse::cust_init(const int freq ) {
     for ( i = TRANSITION_BYTES;
          i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
            / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -279,7 +279,7 @@ bool FGMorse::cust_init(const int freq ) {
     for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DAH_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * FG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
 
index e9917a8ffe0814d03c1431e5f5fd946ed266425b..d2567a13d47fc76a580445e4c2e9f0c6299cc8c9 100644 (file)
@@ -167,16 +167,16 @@ void fgLIGHT::UpdateAdjFog( void ) {
 
     // first determine the difference between our view angle and local
     // direction to the sun
-    rotation = -(sun_rotation + FG_PI) 
+    rotation = -(sun_rotation + SG_PI) 
        - (f->get_Psi() - globals->get_current_view()->get_view_offset());
     if ( globals->get_current_view()->get_reverse_view_offset() ) {
-       rotation += FG_PI;
+       rotation += SG_PI;
     }
     while ( rotation < 0 ) {
-       rotation += FG_2PI;
+       rotation += SG_2PI;
     }
-    while ( rotation > FG_2PI ) {
-       rotation -= FG_2PI;
+    while ( rotation > SG_2PI ) {
+       rotation -= SG_2PI;
     }
     rotation *= RAD_TO_DEG;
     // fgPrintf( FG_EVENT, FG_INFO, 
index aa8d19228a32630c9d4f7b272135932542f396c2..fd63cd69ff01def26b908fb2ae96afe14c9f0ca0 100644 (file)
 /*
  * assuming the apparent orbit of the moon about the earth is circular,
  * the rate at which the orbit progresses is given by RadsPerDay --
- * FG_2PI radians per orbit divided by 365.242191 days per year:
+ * SG_2PI radians per orbit divided by 365.242191 days per year:
  */
 
-#define RadsPerDay (FG_2PI/365.242191)
+#define RadsPerDay (SG_2PI/365.242191)
 
 /*
  * details of moon's apparent orbit at epoch 1990.0 (after
@@ -99,8 +99,8 @@
  * Eccentricity (eccentricity of orbit)                0.016713
  */
 
-#define Epsilon_g    (279.403303*(FG_2PI/360))
-#define OmegaBar_g   (282.768422*(FG_2PI/360))
+#define Epsilon_g    (279.403303*(SG_2PI/360))
+#define OmegaBar_g   (282.768422*(SG_2PI/360))
 #define Eccentricity (0.016713)
 
 /*
  * 1990.0 (computed as 23.440592 degrees according to the method given
  * in duffett-smith, section 27)
  */
-#define MeanObliquity (23.440592*(FG_2PI/360))
+#define MeanObliquity (23.440592*(SG_2PI/360))
 
 /* static double solve_keplers_equation(double); */
 /* static double moon_ecliptic_longitude(time_t); */
@@ -149,11 +149,11 @@ static double moon_ecliptic_longitude(time_t ssue) {
     D = DaysSinceEpoch(ssue);
 
     N = RadsPerDay * D;
-    N = fmod(N, FG_2PI);
-    if (N < 0) N += FG_2PI;
+    N = fmod(N, SG_2PI);
+    if (N < 0) N += SG_2PI;
 
     M_moon = N + Epsilon_g - OmegaBar_g;
-    if (M_moon < 0) M_moon += FG_2PI;
+    if (M_moon < 0) M_moon += SG_2PI;
 
     E = solve_keplers_equation(M_moon);
     v = 2 * atan(sqrt((1+Eccentricity)/(1-Eccentricity)) * tan(E/2));
@@ -283,13 +283,13 @@ void fgMoonPosition(time_t ssue, double *lon, double *lat) {
 
     ecliptic_to_equatorial( globals->get_ephem()->get_moon()->getLon(),
                            0.0, &alpha, &delta );
-    tmp = alpha - (FG_2PI/24)*GST(ssue);
-    if (tmp < -FG_PI) {
-       do tmp += FG_2PI;
-       while (tmp < -FG_PI);
-    } else if (tmp > FG_PI) {
-       do tmp -= FG_2PI;
-       while (tmp < -FG_PI);
+    tmp = alpha - (SG_2PI/24)*GST(ssue);
+    if (tmp < -SG_PI) {
+       do tmp += SG_2PI;
+       while (tmp < -SG_PI);
+    } else if (tmp > SG_PI) {
+       do tmp -= SG_2PI;
+       while (tmp < -SG_PI);
     }
 
     *lon = tmp;
@@ -317,14 +317,14 @@ static void fgMoonPositionGST(double gst, double *lon, double *lat) {
                            globals->get_ephem()->get_moon()->getLat(), 
                            &alpha,  &delta );
 
-//    tmp = alpha - (FG_2PI/24)*GST(ssue);
-    tmp = alpha - (FG_2PI/24)*gst;     
-    if (tmp < -FG_PI) {
-       do tmp += FG_2PI;
-       while (tmp < -FG_PI);
-    } else if (tmp > FG_PI) {
-       do tmp -= FG_2PI;
-       while (tmp < -FG_PI);
+//    tmp = alpha - (SG_2PI/24)*GST(ssue);
+    tmp = alpha - (SG_2PI/24)*gst;     
+    if (tmp < -SG_PI) {
+       do tmp += SG_2PI;
+       while (tmp < -SG_PI);
+    } else if (tmp > SG_PI) {
+       do tmp -= SG_2PI;
+       while (tmp < -SG_PI);
     }
 
     *lon = tmp;
index 05c6eac8f671648b1251add050381e906f5abd93..e693757f1cb48093bb76269ac1e217b95990d42c 100644 (file)
@@ -68,7 +68,7 @@
 #include "sunpos.hxx"
 
 // #undef E // should no longer be needed
-#define MeanObliquity (23.440592*(FG_2PI/360))
+#define MeanObliquity (23.440592*(SG_2PI/360))
 
 static void   ecliptic_to_equatorial(double, double, double *, double *);
 static double julian_date(int, int, int);
@@ -191,13 +191,13 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) {
 
     ecliptic_to_equatorial( globals->get_ephem()->get_sun()->getLon(),
                            0.0, &alpha, &delta );
-    tmp = alpha - (FG_2PI/24)*GST(ssue);
-    if (tmp < -FG_PI) {
-       do tmp += FG_2PI;
-       while (tmp < -FG_PI);
-    } else if (tmp > FG_PI) {
-       do tmp -= FG_2PI;
-       while (tmp < -FG_PI);
+    tmp = alpha - (SG_2PI/24)*GST(ssue);
+    if (tmp < -SG_PI) {
+       do tmp += SG_2PI;
+       while (tmp < -SG_PI);
+    } else if (tmp > SG_PI) {
+       do tmp -= SG_2PI;
+       while (tmp < -SG_PI);
     }
 
     *lon = tmp;
@@ -225,14 +225,14 @@ static void fgSunPositionGST(double gst, double *lon, double *lat) {
                            globals->get_ephem()->get_sun()->getLat(),
                            &alpha, &delta );
 
-//    tmp = alpha - (FG_2PI/24)*GST(ssue);
-    tmp = alpha - (FG_2PI/24)*gst;     
-    if (tmp < -FG_PI) {
-       do tmp += FG_2PI;
-       while (tmp < -FG_PI);
-    } else if (tmp > FG_PI) {
-       do tmp -= FG_2PI;
-       while (tmp < -FG_PI);
+//    tmp = alpha - (SG_2PI/24)*GST(ssue);
+    tmp = alpha - (SG_2PI/24)*gst;     
+    if (tmp < -SG_PI) {
+       do tmp += SG_2PI;
+       while (tmp < -SG_PI);
+    } else if (tmp > SG_PI) {
+       do tmp -= SG_2PI;
+       while (tmp < -SG_PI);
     }
 
     *lon = tmp;