Menu

#10 gmath.c - nmea_distance_ellipsoid

NMEA Library v0.4.x
open
nobody
None
5
2015-06-05
2010-02-04
Anonymous
No

There is a problem when the longitude of the start pose and the end pose are the same. The distance between the two points are always 0.
The problem is caused by the output condition of the iteration. Now is:

while ((fabs(delta_lambda) > 1e-12) && (remaining_steps > 0))

but delta_lambda is set as zero when the lon are the same and the iteration calculation doesn't start.
We need to do at least one iteration. A possible solution is like this:

while (( remaining_steps == 20 ) || ((fabs(delta_lambda) > 1e-12) && (remaining_steps > 0)))

In this way the calculation is correct.
Thank you
Matteo unetti

Discussion

  • Ferry Huberts

    Ferry Huberts - 2011-02-24

    can you clone from https://github.com/fhuberts/nmealib and supply patch?

     
  • Ferry Huberts

    Ferry Huberts - 2015-06-05
    Post awaiting moderation.

Log in to post a comment.