Finding distance between two points from 3D coordinates?

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.

Antworten (2)

Jan
Jan am 6 Feb. 2018
Bearbeitet: Jan am 15 Feb. 2018
sqrt(sum((A - B) .^ 2))
or:
norm(A - B)
Muhammd
Muhammd am 14 Mär. 2023

0 Stimmen

P1=[x,y,z] P2=[x1,y1,z1] D=norm(P1-P2)

Kategorien

Mehr zu Guidance, Navigation, and Control (GNC) finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 6 Feb. 2018

Beantwortet:

am 14 Mär. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by