Why is this bearing calculation so inacurate?

我与影子孤独终老i 提交于 2019-12-04 03:23:35
High Performance Mark

If you've done what you seem to have done and done it correctly you have figured out the bearing of A from B along the shortest route from A to B which, on the surface of the spherical (ish) Earth is the arc of the great circle between A and B, NOT the arc of the line of latitude between A and B.

Mathematica's geodetic functions give the bearings, for your test positions, as 89.7061 and 270.294.

So, it looks as if (a) your calculation is correct but (b) your navigational skills need polishing up.

Are you sure this is due to numeric problems? I must admit, that I don't exactly know what you are trying to calculate, but when you dealing with angles on a sphere, small deviations from what you would expect in euclidian geometry.

java.lang.AssertionError: expected:<270.0> but was:<270.29389750911355>

This 0.29 absolute error represents a relative error of 0.1%. How is this "a long way off"?

Floats will give 7 significant digits; doubles are good for 16. Could be the trig functions or the degrees to radians conversion.

Formula looks right, if this source is to be believed.

If I plug your start and final values into that page, the result that they report is 089°42′22″. If I subtract your result from 360 and convert to degrees, minutes, and seconds your result is identical to theirs. Either you're both correct or you're both wrong.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!