sdm-help-list > Euclidean distance web utility formula
Showing 1-5 of 5 posts
Display:
Results per page:
Nov 22, 2022  10:11 AM | Gaël Cordero
Euclidean distance web utility formula
Dear experts,

I was wondering what formula the web utility for calculating distance between two coordinates (https://www.sdmproject.com/utilities/?sh...) employs. I gather that this is not outputting a normal euclidean distance since the result provided by the web utility differs from the result I obtain when performing the computation manually.

Best,

Gaël
Nov 22, 2022  10:11 AM | Joaquim Radua
RE: Euclidean distance web utility formula
Dear Gaël

The website uses the standard formula...

Can you share an example?

With best wishes.

Joaquim
Nov 22, 2022  10:11 AM | Gaël Cordero
RE: Euclidean distance web utility formula
Thank you very much for anwsering so quickly.

Take these two coordinates:
a: -62 -28 28
b: -53 -37 25

The web utility determines that there is a 9mm difference between them.
However, when using matlab to calculate the same distance (code below) i get 13.0767 mm.

x = (a(1) - b(1))^2
y = (a(2) - b(2))^2
z = (a(3) - b(3))^2
ed = sqrt(x + y + z)

Maybe I'm messing up my code...?

Thank you
Nov 22, 2022  10:11 AM | Joaquim Radua
RE: Euclidean distance web utility formula
Oh! You should separate the numbers with commas, i.e.:
a: -62,-28,28
b: -53,-37,25