I apologize in advance if this is a dumb question. I tried searching for duplicates but couldn't find any. Also, it is more of a curiosity, than a real question, so I hope it fits within the site guidelines.
Backstory
Yesterday, I was driving through California's Central Valley, thinking about how most of the roads there are orthogonal, directed north-south or east-west, creating some sort of square grid. Similar pattern to one found in many American cities and towns, with square grid layouts.
Here is a snapshot from Google Maps near Turlock, CA
I had driving directions on, and wondered for a bit about how an algorithm would calculate the shortest/fastest path when traveling "diagonally" (northeast -> southwest, for example). I didn't spend too much time on that, since some of these roads have different features, speed limits, etc.
Instead, I started thinking about different ways to calculate the distance between opposite corners of a square or rectangle (for simplification, I will focus on squares moving forward, but the math applies to both).
Pythagoras
We know that using Pythagoras, we can calculate the hypotenuse as the square root of the sum of the sides squared:
$ h = \sqrt{a^2 + b^2} $
Thus, for a 10 by 10 square, the hypotenuse will be the square root of 200: 14.1421...
Not Pythagoras
Ok, now, consider this. Given a 10 by 10 square (think of a city block, or orthogonal roads like the ones above), if we want to travel from one corner (A) to the opposite corner (B), first we need to visit one of the remaining two corners.
In this case, the distance traveled would be 10 + 10 = 20
(much longer than the 14.14 hypotenuse).
Now, if we divide this square into 4 equal squares, and we travel through the center, the distance traveled will remain the same: 5 + 5 + 5 + 5 = 20 units
.
The number of horizontal segments is equal to the number of columns (2 in this case).
The length of each horizontal segment is equal to the width divided the number of columns:
$ s_h = \frac{width}{columns} $
Thus, the distance traveled horizontally $ d_h $ would be $ s_h * columns $, or in other words, equal to the total width.
The same applies to the distance traveled vertically $ d_v $, where the total distance will be equal to the total height.
$ d_h = columns * \frac{width}{columns} = width $
$ d_v = rows * \frac{height}{rows} = height $
It seems to be the case that the number of columns and rows does not matter, as the distance traveled will always be the sum of the width (horizontal distance) and height (vertical distance).
We could divide the square infinitely, so we have infinite columns and infinite rows, and the distance will still be the same (20 units in this example).
Wait a minute...
My Conjectures
According to the above, the distance traveled through infinite segments will be 20.
Why is the value so different from the hypotenuse (almost 50% higher), given than the path from A to B would pretty much represent a diagonal line at that point?
It's been long since I studied integrals and Calculus, so I'm looking for someone that would not mind spending some time explaining this.
Thank you!
PS: I looked at this question, which has a nice diagram similar to mine, but the Manthatan Distance (aka Taxicab Geometry) is not what I'm looking for, as it does not mention any relation with hypotenuse distance when the number of segments approaches infinity.