已知一个点坐标和一个由三点组成的平面(这三点坐标已知),求这个点在这个平面上的投影坐标。

我想咨询下,你的实现方法是怎样的?想学习学习。谢谢。
2025-02-25 17:34:39
推荐回答(2个)
回答1:

你这个问题利用向量就可以很轻松的解决。第一步:设出投影坐标(xyz),第二步:用已知点和设出的点组成一个向量。第三步:由平面上的三个点两两结合组成三个向量。第四步:用第一个向量与平面上的三个向量分别相乘,就可以得出一个三元一次方程组。解得这个方程组就可得出答案。希望能帮助到你哟!

回答2:

这个是我之前的提问,别人做的回答,这个方法我觉得很好。
First of all, let's make some vectors based on your given points:
b=B-A
c=C-A
d=D-A
, In other words, we simply let A be the original point. Vectors b, c, and d are connecting from A to B, to C, and to D, respectively. We are going to answer your questions based on these vectors.

To check if A, B, and C are not in a straight line, we simply need to check if vector b and c are independent. We use the rank of matrix with verctor b and c to determine:

r = rank([b c])

Here we assume b and c are column vectors. (If b and c are row vectors, r = rank([b;c]) in Matlab) Now, If r=2, vector b and c are independent, in other words, A, B and C are not in one straight line, they can determine a plane.

We assume b and c are independent now. We use the following steps to obtain a basis:
(1) take b as the first vector: v1 = b
(2) get the normal vector of the plane determined by b and c:
v3 = cross(b,c)
(3) get the third vector which is orthogonal to both v1 and v3:
v2 = cross(v3, v1)
*Note: v2 must be on the plane defined by b and c, or equavilently by A, B and C
(4) normalize v1, v2 and v3, we get:
e1 = v1 / norm(v1)
e2 = v2 / norm(v2)
e3 = v3 / norm(v3)
Then, e1, e2 and e3 form a basis of whole 3D spance.

To get the projection of D onto plane ABC, you can get the inner product of d and each vector of the basis :
p1 = dot(d,e1)
p2 = dot(d,e2)
p3 = dot(d,e3)
Then:
projectionOfDOntoABC = p1*e1+p2*e2+p3*e3

Finally, e1 and e2 form a basis of the plane ABC. You can use (p1,p2) as the coordinates with respect to the basis e1,e2 to refer a point on the plane.