# Why is squared Euclidean distance used for measuring similarity? Why is it squared? [closed]

Why is squared Euclidean distance used for measuring similarity?

https://en.wikipedia.org/wiki/Similarity_measure

Particularly,

why are we looking at a squared quantity?

And is one supposed to take the square root of it at some point to get the "final result"?

• @Munchhausen So is the idea that one takes the square root after one wants the "final result"? Jun 26, 2018 at 12:40
• The square/square root in $\|\cdot \|_2$ is what makes balls' boundaries actual circles. It comes from the Pythagorean theorem. But I'm not sure what exactly you are asking. Jun 26, 2018 at 12:40
• @ArnaudMortier Why is it squared, rather than without square? Also perhaps, how is it then used in practice (does one take the square root at some point)? Jun 26, 2018 at 12:41
• Perhaps because the euclidean distance is invariant to rigid rotations? Jun 26, 2018 at 12:43
• The square of euclidean distance is differentiable, allowing for algorithms like gradient descent. Also, it is convex. Jun 26, 2018 at 12:45

I would like to highlight the fact that the article says

Frey and Dueck suggest defining a similarity measure $$s(x, y) = - || x - y ||_{2}^{2}$$ where $|| x - y ||_{2}^{2}$ is the squared Euclidean distance.

There are many ways to measure distance --- the article also mentions Gaussian distance as a way of measuring distance.

I would guess that the choice of which distance you use depends on what data you are analysing, and what the common conventions in that area of research are.

As for the Euclidean distance itself, as Arnaud Mortier mentioned in the comments the definition of Euclidean distance comes from Pythagoras' Theorem. By reading the link to the squared Euclidean distance, it indicates that:

The standard Euclidean distance can be squared in order to place progressively greater weight on objects that are farther apart.

This is not a metric, but is useful for comparing distances. See the comments for reasons why this is a good measure to use.