Finding distance between two points from 3D coordinates?

72 ビュー (過去 30 日間)
HC1992
HC1992 2018 年 2 月 6 日
回答済み: Muhammd 2023 年 3 月 14 日
If I have two points in 3d, A = [1579.4 51.2 279]
B = [1674.4 86.7 249]
these are (x, y, z) coordinates in mm, What is the easiest way to compute the distance (mm) between these two points in matlab,
Thanks.

回答 (2 件)

Jan
Jan 2018 年 2 月 6 日
編集済み: Jan 2018 年 2 月 15 日
sqrt(sum((A - B) .^ 2))
or:
norm(A - B)

Muhammd
Muhammd 2023 年 3 月 14 日
P1=[x,y,z] P2=[x1,y1,z1] D=norm(P1-P2)

カテゴリ

Help Center および File ExchangeGuidance, Navigation, and Control (GNC) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by