Tag: compass geolocation

获得两个标题之间的区别

我有这种方法来计算2 0-360指南针标题之间的区别。 虽然这可以用来确定我的绝对距离(例如,总是正输出),但我无法弄清楚要将标志引入输出需要做些什么。 理想情况下,如果从初始航向到最后航向的最短距离是顺时针方向,我希望error有一个正号,如果标题之间的最短距离涉及逆时针方向,我会喜欢error有负号。 一些期望的输入/输出的例子 initial – final – error 0 ……………….. 30 ………. 30 30 ……………….. 0 ………. -30 360 ……………….. 1 ………. 1 1 ……………….. 360 ………. -1 码: /// /// Calculate the error from a given initial heading to a final heading /// /// /// /// private double GetHeadingError(double initial, double final) […]