2

我可以计算斜线和我的球之间的距离(使用法线向量),但是如何计算新的速度?

说明性图像

4

2 回答 2

1

If The vector v=(vx,vy) is the initial velocity and the plane has normal n=(nx,ny) then the new reflected velocity vector r will be

r=v−2(v⋅n)*n

The product (v⋅n) is the dot product of v and n, defined as vxnx+vyny. Note that the plane normal must be normalized (length 1.0). A related question with the same answer https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector

于 2013-09-11T08:39:18.430 回答
1

安德斯的回答很好,但我意识到你可能没有很好的数学背景,所以我会详细说明。您目前遇到的问题没有很好地说明。不过请看下图

在此处输入图像描述

这将使我们能够推导出您需要的方程式。现在,两个向量ab的标量积ab给出a乘以ba的投影的大小。基本上,如果我们将n作为单位向量(每个分量方向上的大小为 1),那么an给出了沿n方向作用的a分量的大小。

因此,将速度分量分成平行和垂直于平原的分量;为了获得速度V,我们首先将U拆分为多个分量。

在方向n上垂直于平面,我们有一个矢量速度w = ( Un ) n。这意味着实际上我们可以写成U = ( Un ) n + [ U - ( Un ) n ]。这就是说U由自身的垂直分量 + 自身的平行分量组成。现在,-V与U非常相似,但平行分量的作用方向相反,所以我们可以写成-V = ( Un ) n - [ U - ( Un) n ]。

结合以上给出了安德斯所说的结果,即V = U -2[( Un ) n ]。点/标量积定义为ab = |a||b|cos(A) 其中 A 是尾对尾放置在一起的向量之间的角度,这应该可以帮助您解决问题。

我希望这有帮助

于 2013-09-11T09:45:48.677 回答