The function geo_inverse_wgs_84 either produces a segmentation fault or
goes into an infinite loop in some situations. I've attached a short
program that illustrates some of the problems. I can't suggest any
fixes, as the math is beyond me, so I'm hoping someone on this list can
take a look at it and figure out what's wrong.
----------------------------------------------------------------------
#include <stdio.h>
#include <simgear/math/sg_geodesy.hxx>
int main(int argc, char *argv[])
{
double az1, az2, s;
// Segmentation fault
geo_inverse_wgs_84(0.0, 0.0, 90.0, 0.0, &az1, &az2, &s);
// Segmentation fault
geo_inverse_wgs_84(0.0, 0.0, 0.0, 180.0, &az1, &az2, &s);
// Segmentation fault
geo_inverse_wgs_84(0.0, 10.0, 0.0, 190.0, &az1, &az2, &s);
// Segmentation fault
geo_inverse_wgs_84(0.0, 10.0, 0.0, -170.0, &az1, &az2, &s);
// Infinite loop
geo_inverse_wgs_84(25.069512023269287, 121.55219577157995,
-24.801366884400881, -57.936205714430365,
&az1, &az2, &s);
}
------------------------------------------------------------------------------
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel