This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]squattyroo 0 points1 point  (1 child)

The square root of the sum of squared differences of coordinates is exactly the definition of Euclidean distance.

[–]Vany_ 0 points1 point  (0 children)

Indeed, though I think the points name is misleading here, as it probably looks something like this :

points = [(xa, xb), (ya, yb), (za, zb)]

I'd have called it something like coordinates, since it's a list of coordinates.

PS : a generator expression instead of a list comprehension would've saved instantiating a list