# Is there a derivation or geometric intuition for the distance formula?

By distance formula I mean: $$ds^{2} = \sum_{i}dx_{i}^{2}$$

One can find visual geometric proofs for the Pythagorean theorem, but I am wondering if there is a way for me to intuitively understand why summing up the squared distance of orthogonal components gives the total squared distance. This always seems to be a starting point, but how would one figure this out in the first place if starting from scratch?

For context I am primarily trying to understand how the metric tensor allows for the correct calculation of distance for non-orthogonal coordinate systems. But I realized in order to understand this I first need to understand why the special case works for an orthogonal basis (i.e. metric tensor is the identity matrix; no cross terms for $$ds^{2}$$). Then I can work on understanding why one needs to add in the cross terms from the off-diagonal components of the metric tensor when calculating distances using a non-orthogonal basis. Intuitive visuals would be most helpful, but any general pointers would be appreciated. Thanks!

• The metric tensor defines distances.
– amd
Apr 20, 2020 at 6:04
• But how/why did we find the correct expression that would work? I can draw a non-orthogonal coordinate system on a physical piece of paper, and use a ruler to measure the length of vectors I draw from the origin. There will be only one correct formula to calculate those vector lengths from the corresponding measured contravariant vector components. That formula is given by the metric tensor. We could not have defined it another way, or it would not have worked. How did we find that formula? Apr 20, 2020 at 6:43
• Your use of the words "ruler, length" suggests you already have a preconceived notion of geometry. The point of the previous comment is to say that a metric tensor "tells you what rulers and protractors are". It seems like you need to completely reverse your perspective; here are two answers I wrote previously (I think reading them in order is better). They don't directly address your issue, but there are a few points which I think might be useful. math.stackexchange.com/a/3595678/568204 and math.stackexchange.com/a/3492817/568204 Apr 23, 2020 at 20:04
• But in short, if $ds^2 = \sum_{i=1}^n dx_i^2$ (where $(x^1(\cdot), \dots x^n(\cdot)) = \text{id}_{\Bbb{R}^n}$, i.e cartesian coordinates ), then it means you have defined a Euclidean geometry. If you consider a different metric tensor, then you'll end up with a different geometry. But one good thing it seems from your comment is that you realize that just because you use curvilinear cordinates (say polar coordinates) it doesn't affect lengths of vectors; the formula for calculating the length might look different but the final number will of course be the same. Apr 23, 2020 at 20:05
• Those were very well written and useful comments that gave me insight into questions I didn't yet know I had, so thank you for that. I (think) I understand the notion that "the dot product and tensor define the geometry" and not the other way around. However, the question I am trying to ask is this: if I told you I define geometry as (for example) "that intuitive thing with flat paper and rulers" and you knew nothing else of math, how would you then discover that the (corresponding) dot product and metric tensor gives the right formula to produce that intuitive geometry? Just guess & check? Apr 25, 2020 at 5:41

After lots of reading and thinking, I think I figured it out. For posterity, the following is my reasoning. I am not claiming this to be any kind of formal proof or derivation, but rather a way of looking at the problem that gives me physical intuition for why the distance formula and metric tensor give what I intuitively think of as "length" in (Euclidean) space.

First, a physical intuition for why a dot product gives a projection is very well explained by 3Blue1Brown here. The idea of "projecting a vector onto itself" feels to me like a good intuitive procedure to measure its length, and this video shows why that procedure is produced mathematically by summing the products of two vector's components (by thinking of $$\vec{V}^{T}$$ as a linear transformation). Projecting a vector onto itself can be thought of as measuring how far it reaches along the 1D number line parallel to it (as depicted in the video), so I am ok accepting that as one intuitive sense of length.

Next we can imagine a non-orthogonal coordinate system for flat 2D Euclidean space. Lets say the normalized basis vectors are $$\hat{e_{1}}$$ and $$\hat{e_{2}}$$, which are not orthogonal to each other. We can construct a 2 x 2 matrix that is a linear transformation from the 2D cartesian plane to this new basis. Call this matrix A, and its columns are the transpose (i.e. column vectors) of the {e} basis vectors.

So let's say we now have a vector $$\vec{V}$$ written in the {e} basis (i.e. it has scalar contravariant components $$V_{e_{1}}$$ and $$V_{e_{2}}$$ such that $$\vec{V} = V_{e_{1}}\hat{e_{1}} + V_{e_{2}}\hat{e_{2}}$$), and we want to measure its length. We can first do a change of basis back to our orthognormal cartesian basis where we know how to measure length (using the "sum of components squared" formula intuitively given by the above video). The vector's length is the same before and after any basis change (since the length of a vector is independent of the basis we choose to describe it). We will write the vector $$\vec{V}$$ written in the cartesian basis as $$\vec{V'}$$. We can find $$\vec{V'} = A\vec{V}$$, again remembering its length is unchanged by change of basis.

So now we just take the dot product of $$\vec{V'}$$ with itself:

$$\vec{V'} \cdot \vec{V'} = (\vec{V'})^{T}\vec{V'} = (A\vec{V})^{T}A\vec{V} = \vec{V}^{T}A^{T}A\vec{V}$$

That middle part, $$A^{T}A$$ works out to be the metric tensor, if you go through the algebra. We also see that the metric tensor must be a symmetric matrix, as it is formed by the product of a square matrix with its transpose. This then recovers the distance formula for a vector in Euclidean space using non-orthogonal coordinates, in a (for me) somewhat physically intuitive way.

Again, I do not present this as a proof of any kind, but just a way of thinking about it that gave me a bit better physical intuition for "Why this formula?". I welcome any corrections or additions.