Skip to content

Commit 742db16

Browse files
authored
Update manhattan-distance.md (#1490)
Transformation \alpha was wrong, because it should just Quote: rotation of the plane followed by a dilation about a center Wrong transformation: (x=1,y=100) -> (x'=101, y'=-99) (wrong transformation is 135 degrees clockwise in this case, not 45), Correct transformation: (x=1,y=100) -> (x'=101, y'=99) Basically, I removed reflection over line x
1 parent e8e3022 commit 742db16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/geometry/manhattan-distance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ To prove this, we just need to analyze the signs of $m$ and $n$. And it's left a
6767

6868
We may apply this equation to the Manhattan distance formula to find out that
6969

70-
$$d((x_1, y_1), (x_2, y_2)) = |x_1 - x_2| + |y_1 - y_2| = \text{max}(|(x_1 + y_1) - (x_2 + y_2)|, |(x_1 - y_1) - (x_2 - y_2)|).$$
70+
$$d((x_1, y_1), (x_2, y_2)) = |x_1 - x_2| + |y_1 - y_2| = \text{max}(|(x_1 + y_1) - (x_2 + y_2)|, |(y_1 - x_1) - (y_2 - x_2)|).$$
7171

72-
The last expression in the previous equation is the [Chebyshev distance](https://en.wikipedia.org/wiki/Chebyshev_distance) of the points $(x_1 + y_1, x_1 - y_1)$ and $(x_2 + y_2, x_2 - y_2)$. This means that, after applying the transformation
72+
The last expression in the previous equation is the [Chebyshev distance](https://en.wikipedia.org/wiki/Chebyshev_distance) of the points $(x_1 + y_1, y_1 - x_1)$ and $(x_2 + y_2, y_2 - x_2)$. This means that, after applying the transformation
7373

74-
$$\alpha : (x, y) \to (x + y, x - y),$$
74+
$$\alpha : (x, y) \to (x + y, y - x),$$
7575

7676
the Manhattan distance between the points $p$ and $q$ turns into the Chebyshev distance between $\alpha(p)$ and $\alpha(q)$.
7777

0 commit comments

Comments
 (0)