查找非线性点的简单方法

问题描述 投票:0回答:1

我在3d空间中有一行:(x1,y1,z1),(x2,y2,z2)我需要在保证不与这条线共线的任何平面中找到任何点。找到这一点的最简单,最简单的方法是什么?

3d geometry
1个回答
0
投票

您需要一些非共线向量来建立所需的点。

有一种获取垂直向量的方法:

make vector d = (x2-x1, y2-y1, z2-z1)
choose component with the largest magnitude (say dy)
and component with the second magnitude (say dx)
make the third (smallest) component zero
exchange two larger components and negate the largest one
p = (-dy, dx, 0)

与源一垂直(请注意,点积为零p.dot.d==0

将此向量添加到任何端点以获得非共线点。

© www.soinside.com 2019 - 2024. All rights reserved.