1
0
Fork 0

#561, clean-up using normalizePeriodic. Thanks to Hyde & James.

This commit is contained in:
ThorstenB 2012-01-07 08:17:34 +01:00
parent da7adf63c0
commit 484d3c61f8

View file

@ -365,11 +365,8 @@ getMagDip ()
static double
getHeadingMag ()
{
double magheading;
magheading = fgGetDouble("/orientation/heading-deg") - getMagVar();
if (magheading <= 0) magheading += 360;
else if (magheading > 360) magheading -= 360;
return magheading;
double magheading = fgGetDouble("/orientation/heading-deg") - getMagVar();
return SGMiscd::normalizePeriodic(0.5, 360.5, magheading );
}
/**
@ -378,11 +375,8 @@ getHeadingMag ()
static double
getTrackMag ()
{
double magtrack;
magtrack = fgGetDouble("/orientation/track-deg") - getMagVar();
if (magtrack <= 0) magtrack += 360;
else if (magtrack > 360) magtrack -= 360;
return magtrack;
double magtrack = fgGetDouble("/orientation/track-deg") - getMagVar();
return SGMiscd::normalizePeriodic(0.5, 360.5, magtrack );
}
static bool