Your question is confusing, do you want to find the point of intersection or do you want a perpendicular vector?
There's an infinite amount of vectors that are perpendicular to your given vector. If you want just any of those, turn your v1 vector by 90 degrees: v2 = (-y1, x1, z1).
在 3D 中,任何给定向量都有无数个垂直向量。对于任何向量方向,即,没有特定方向,您可以取您的向量与任何其他向量的叉积。
In 3D, there are an infinite number of perpendicular vectors to any given vector. For any vector direction, i.e., no specific direction, you can take the cross-product of the your vector and any other vector.
发布评论
评论(3)
你的问题很混乱,你想要找到交点还是想要一个垂直向量?
有无数个向量垂直于给定的向量。如果您只需要其中任何一个,请将
v1
向量旋转 90 度:v2 = (-y1, x1, z1)
。至于线交叉,请考虑到(如前所述)3D 空间中的 2 条线几乎永远不会相互交叉。解决方案:http://softsurfer.com/Archive/algorithm_0106/algorithm_0106.htm。
谷歌是你的朋友。
Your question is confusing, do you want to find the point of intersection or do you want a perpendicular vector?
There's an infinite amount of vectors that are perpendicular to your given vector. If you want just any of those, turn your
v1
vector by 90 degrees:v2 = (-y1, x1, z1)
.As for the line crossing, take into account that (as said before) 2 lines in 3D space will almost never cross each other. Solution: http://softsurfer.com/Archive/algorithm_0106/algorithm_0106.htm.
Google is your friend.
在 3D 中,任何给定向量都有无数个垂直向量。对于任何向量方向,即,没有特定方向,您可以取您的向量与任何其他向量的叉积。
In 3D, there are an infinite number of perpendicular vectors to any given vector. For any vector direction, i.e., no specific direction, you can take the cross-product of the your vector and any other vector.
与给定向量正交的向量有无数个。此外,任意两条线在 3D 中可能不会相交。
There are infinite number of vectors that are orthogonal to the given vector. Also, two arbitrary lines may not intersect in 3D.