distance from point to plane (plane was created from 3d point data)

29 ビュー (過去 30 日間)
ha ha
ha ha 2017 年 12 月 7 日
コメント済み: Joerg Fricke-Schmidt 2022 年 10 月 31 日
Let's say : a plane N contain a set of 3d coordinate data (A).
A=[x1 y1 z1
x2 y2 z2
x3 y3 z3
........]
plane N is determined by normal vector (n) and center coordinate (P0).
I have a point X(x0,y0,z0) which is located outside plane N. How can I find perpendicular distance from point X to plane N?
Note: I know how to find the normal vector(n) and P0 from the set of data A.

採用された回答

John D'Errico
John D'Errico 2017 年 12 月 7 日
編集済み: John D'Errico 2017 年 12 月 7 日
You need to understand what the equation of a plane tells you.
A plane is defined by a point on the plane (P0), and the normal vector to the plane(N). Thus any point on the plane X satisfies the constraint
dot(X-P0,N) = 0
If the normal vector has unit length, so it is normalized to have norm(N)==1, then the solution to your problem is trivial.
The distance to the plane is then simple. It is just:
dot(X-P0,N)
If a point lies on the plane, then the distance to the plane is 0. And that is embodied in the equation of a plane that I gave above!
Finally, you might recognize that the above dot product is simply computed using the function dot, but even more simply written as a matrix multiply, if you have more than one point for which you need to compute this distance.
  3 件のコメント
John D'Errico
John D'Errico 2017 年 12 月 15 日
Yes ... and that is the dot product that I referred to. As I said in my last paragraph, you can use just a matrix multiply. Abs handles the issue that a point can be on one side of the plane or the other. So the sign tells you where the point is relative to the normal vector.
I wrote it using the dot function to make the idea of a dot product clear.
Joerg Fricke-Schmidt
Joerg Fricke-Schmidt 2022 年 10 月 31 日
@John D'Errico: How exactly do I have to multiply a matrix with multiple points with P0 and N of the surface? I would like to have distances calculated for multiple points gathered in may X, Y, Z matrix.
Thanks a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by