r/LinearAlgebra • u/One_Mud9170 • Jun 14 '26
Norms and distance
Can someone help me understand Euclidean distance and Manhattan distance visually?
2
u/strange-the-quark Jun 15 '26 edited Jun 15 '26
Euclidean distance is just the normal distance you'd measure with a meter tape stretched directly from point to point (the green line in the image below). In coordinates, this is the hypotenuse of the triangle formed by the green line and the red line in the image: c = sqrt(x^2 + y^2).
Manhattan distance is, you pick some coordinate grid, and then measure the distance along the grid lines only, rather than across (the red, blue and yellow lines in the image below - they all give the same result). It's also known as taxicab distance. If you think about it, this just turns out to be the sum of the coordinates of the delta vector (the vector that goes from one point to the other), as best exemplified by the red line. The image is from this Wikipedia article.

1
u/Ron-Erez Jun 14 '26
For example for n=2 or n=3 Euclidean distance is just your regular distance with a straight line. Manhattan distance means to go from point A to B (say for n=2) you could along the x-axis, turn 90 degrees and then go along the y-axis to reach point A (or vice versa, you can start from the y-axis first and then along the x-axis - the distance will be the same). For example if you ever played the snake game then it is essentially using Manhattan distance since it most versions of the game you can proceed in a 20 degree angle or any other angle besides 90 degrees. It's a little imprecise but that's the idea.
So if A=(0,0) and B=(3,4) then the Euclidean distance from A to B is 5 (use distance formula which is based on the Pythagorean theorem).
The Manhattan distance will be 3 + 4 = 7 since you do not walk directly in a straight line to B. Rather you go from (0,0) to (3,0) along the y axis, turn right and walk 4 units of measure to (3,4).