sdm-help-list >

**Euclidean distance web utility formula**Showing 1-5 of 5 posts

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

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

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

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

And the answer will be 13.0767 as you had calculated.

:-)

a: -62,-28,28

b: -53,-37,25

And the answer will be 13.0767 as you had calculated.

:-)

Nov 22, 2022 11:11 AM | Gaël Cordero

RE: Euclidean distance web utility formula

Ohhhh!!!!

I see, I should have thought about trying that

Thank you for satisfying my curiosity.

Best,

Gaël

I see, I should have thought about trying that

Thank you for satisfying my curiosity.

Best,

Gaël