问题标签 [trilateration]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
55 浏览

python - 蓝牙信标 3D 三边测量

我有这段代码,不幸的是它对我不起作用。我收到此错误:

RuntimeWarning:在 sqrt z1 = np.sqrt(r1 ** 2 - x ** 2 - y ** 2) 中遇到无效值

RuntimeWarning:在 sqrt z2 = np.sqrt(r1 ** 2 - x ** 2 - y ** 2) * (-1) 中遇到无效值

点的位置是:[nan nan nan]

编辑,我有这个问题的解决方案:

它不起作用,因为我们无法计算 NaN * (-1),这就是为什么其余代码不起作用的原因。

相反,我们应该像这样编写代码:

现在它的工作正常。