#561, clean-up using normalizePeriodic. Thanks to Hyde & James.
This commit is contained in:
parent
da7adf63c0
commit
484d3c61f8
1 changed files with 4 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue