Finding distance between two points from 3D coordinates?

조회 수: 66 (최근 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 CenterFile Exchange에서 Guidance, 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