【发布时间】:2019-09-02 17:16:29
【问题描述】:
我正在尝试使用此处提供的答案:Intersection of two Moving Objects with Latitude/Longitude Coordinates
但我有一些问题..
这个角度是多少:
var angle = Math.PI + dir - target.dir
我在想应该在余弦定律中使用的角度已经是“alpha or target.dir”。那条线在做什么?同样在这两个步骤中:
var x = target.x + target.vel * time * Math.cos(target.dir);
var y = target.y + target.vel * time * Math.sin(target.dir);
代码不应该使用 x 轴或 y 轴与目标速度向量之间的角度吗?为什么作者在这里使用 alpha?
【问题讨论】:
-
很高兴您将其发布为问题!我ping了原作者,也许他会给我们一些见解......
-
@JonasWilms 感谢您告诉我。今天晚些时候我会看看它。
标签: javascript math