On 13 Sep 2008, at 09:34, Frederic Bouvier wrote:

> MSVC has a problem compiling this line :
>
> return fabs(az1 > 90.0);
>
>
> and I must admit I also have a problem understanding your intention.  
> You
> are trying to extract the absolute value of a boolean. Should it be
>
> return fabs(az1) > 90.0;
>
>  instead ?

Gracious yes, that's quite a typo :) As you say, it should be  
fabs(az1) > 90, i.e 'do penalise this navaid if the heading difference  
is more than 90 degrees'

Though this whole function was deemed slightly suspect when I  
mentioned it here a few weeks ago. Obviously right now the aim was to  
keep the existing behaviour.

I'm getting more and more encouraged to write a set of course and  
bearing helpers to deal with the normalisation and differencing. I've  
lost count of the number of times I've seen the:

   if ( az1 >  180.0) az1 -= 360.0;
   if ( az1 < -180.0) az1 += 360.0;

Idiom repeated in the code, and lots of classes already have helpers  
for this - the KLN-89b and Mk-VIII, for example. Maybe there's some  
standard ones in SimGear I haven't spotted yet?

Regards,
James


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to