You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
measure.SpheroidDistance returns NaN for some data #114
Hello! Here is some test example that passes. For this input data measure.SpheroidDistance returns Nan.
I think the reason is rounding error of theta := lng1 - lng0. theta is actually a bit greater than zero and therefore math.Sin(lat0)*math.Sin(lat1) + math.Cos(lat0)*math.Cos(lat1)*math.Cos(theta) a bit greater than one and math.Acos(math.Sin(lat0)*math.Sin(lat1) + math.Cos(lat0)*math.Cos(lat1)*math.Cos(theta)) returns Nan.
That's what debugger shows:
What I expect: function returns 0 for this case and actually never returns NaN.
I'm using github.com/spatial-go/geoos v1.1.3 but as I far as I see, v1.2 has the same code of this function
Activity