February 25, 200521 yr 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
February 25, 200521 yr Commercial Member 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 Jon Blum Vertical Reality Simulations
February 25, 200521 yr 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
February 25, 200521 yr Author Hi Jon, ArneYes, solutions are usually easy once you know the problem :-)Cheers, Rob
Create an account or sign in to comment