给你一个函数
Public Sub Vect1XtoVect2(ByVal x1 As Double, ByVal y1 As Double, ByVal z1 As Double, _
ByVal x2 As Double, ByVal y2 As Double, ByVal z2 As Double, _
ByRef xNew As Double, ByRef yNew As Double, ByRef zNew As Double) '矢量叉积
xNew = y1 * z2 - z1 * y2
yNew = z1 * x2 - x1 * z2
zNew = x1 * y2 - y1 * x2
End Sub
其中x1,y1,z1为第一个矢量,x2,y2,z2为第二个矢量
xnew,ynew,znew为得到的新矢量 |