Since dist is calculated by using sqrt() it should never become negative. So 
the line 
> else if (dist <= -y) angle = -90.0;  // against roundoff.
is probably not really needed.
That leaves the question: what happens if dist becomes zero? Apparently that 
means you have hit the gs-antenna and you are sitting exactly on the 
glideslope. By definition thats an angle  of zero.

My suggestion is
         if (dist <= y) angle = 90.0; // roundoff securitycheck
         else if (dist < 1e-3) angle = 0.0;  // within the gs antenna radius
         else angle = asin( y / dist ) * SGD_RADIANS_TO_DEGREES;

Torsten

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to