On 01/10/2009 09:13 AM, Csaba Halász wrote:
> #2  0x000000000080188d in FGNavRadio::update (this=0x98df490,
> dt=0.058333333333333334) at src/Instrumentation/navradio.cxx:613
> 613                     double angle = asin( y / x ) * SGD_RADIANS_TO_DEGREES;
> (gdb) p x
> $1 = 3.2580450943147174
> (gdb) p y
> $2 = 3.258443598627875
> (gdb) p y / x
> $3 = 1.0001223139341602
> 
> No idea what it is calculating and how to fix. (apart from forcibly
> clamping y/x to [-1, 1] ...)

It's calculating your angle of elevation relative to the 
glideslope antenna.  The code would be correct except for
roundoff error.  To provoke this bug you need to sit directly
above the GS transmitter, vertically within a few thousandths 
of a degree, and then get unlucky w.r.t roundoff.

Clamping it is guaranteed 100% safe and effective.


------------------------------------------------------------------------------
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