Jump to content
Sign in to follow this  
rcbarend

XML function "RNOR" BUG !!

Recommended Posts

After 2 day's (and nights :-() of debugging I finally detected why my "great-circle" formula's don't work properly.....Unlike what you would expect (and what is specified in the FS2004 panel SDK), the RNOR function doesnot normalise at "2-PI" (360 degrees, like DNOR), but only at "PI" (180 degrees).Another caution: The Modulo (%) function for negative values might work differently then you would expect:Example: "-1 4 %" gives result "-1", NOT "+3"Not a bug, but just MS'XML implementation of Modulo (this appears to be programming-language / implementation dependant).Hope this saves you some sleepsless nights :-)Cheers, Rob Barendregt

Share this post


Link to post
Share on other sites

Yeah:(A couple ways around that:Convert to degrees and apply dnor then if necessary, convert back.The other method would be to use mod where:6.45771823 = 370 degrees in radians (6.45771823 pi 2 * %) = 0.17453 = 10 degrees normalized--Jon

Share this post


Link to post
Share on other sites
Guest bartels

I didn' write it it too clearly in my xmlgau1 doc that rnor does not work as expected. The modulo functions in any language are not really what you expect mathematically when dealing with negative numbers. That's the reason for some strange huge offsets for some stripe type gauges. Just add a very big number to the altitude and you get a positve number, applying % later will get you back to the normal range anyway.Arne Bartels

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...