0
$\begingroup$

I've been playing around with the Pythagorean theorem trying to find equivalent metrics for distance that don't involve squaring and rooting.

From the definition of cosine it's easy to see that, given a triangle with sides $a, b, c$ and angles $A, B, C$, the length $c$ is simply $a*\cos(B) + b*\cos(A)$.

This works on any triangle, not just right triangles.

Now suppose we want to use this formula as a distance metric in Euclidean space. We'll now label the sides $x, y, d$ where we are given x and y and wish to find d.

According to the above, $d = x*\cos(Y) + y*\cos(X)$ if we can find the angles $X, Y$. If we're given orthogonal axes then it is easy to determine that those angles are $X = \tan^{-1}(x/y)$ and $Y =\tan^{-1}(y/x)$.

This gives us the generalized $d = x*\cos(\tan^{-1}(y/x)) + y*\cos(\tan^{-1}(x/y))$ metric for distance.

I have a few questions about this metric:

  • This should work even if x and y do not fall on orthogonal axes (though you'll have to find X and Y differently). Is that useful in any way? If so, I'm sure it's been used before. What have I stumbled upon?
  • Is there any (elegant) way to show that the above reduces to $\sqrt{x^2+y^2}$ when $x$ and $y$ are on orthogonal axes?
  • how can this be generalized to $n$-space? (it's easy to scale the Pythagorean theorem up to $\sqrt{x^2+y^2+z^2}$ and beyond, but I imagine it would be more complex to scale this).
  • 0
    @JonasMeyer you're right, it's independent of the cosine rule and just dependent upon the definition of cosine -- I just didn't notice it until I was working through the derivation of the Pythagorean theorem from the cosine rule alone.2012-05-22

1 Answers 1

1

I'll address just your second question:

Is there any (elegant) way to show that $d = x*\cos(\tan^{-1}(y/x)) + y*\cos(\tan^{-1}(x/y))$ reduces to $\sqrt{x^2+y^2}$ when $x$ and $y$ are on orthogonal axes?

First, I don't know that it's safe to claim that your $\tan^{-1}$ expressions are the correct angles if $x$ and $y$ are not orthogonal axes. But, given your expressions, we can do some simplification.

enter image description here

Since you said that $x$ and $y$ are sides, I'll make the assumption that $x,y>0$ (if not, then there are likely to be some issues with the range of the inverse tangent function). We can think of $\tan^{-1}(\frac{x}{y})$ and $\tan^{-1}(\frac{y}{x})$ as the two acute angles in a right triangle with legs $x$ and $y$, as shown. The length of the hypotenuse is $\sqrt{x^2+y^2}$. So, $\cos\left(\tan^{-1}\left(\frac{y}{x}\right)\right)=\frac{x}{\sqrt{x^2+y^2}}$ and $\cos\left(\tan^{-1}\left(\frac{x}{y}\right)\right)=\frac{y}{\sqrt{x^2+y^2}},$ which makes your distance expression $\begin{align} d &= x*\cos(\tan^{-1}(y/x)) + y*\cos(\tan^{-1}(x/y)) \\&=\frac{x^2}{\sqrt{x^2+y^2}}+\frac{y^2}{\sqrt{x^2+y^2}} \\&=\frac{x^2+y^2}{\sqrt{x^2+y^2}} \\&=\frac{\sqrt{x^2+y^2}\cdot\sqrt{x^2+y^2}}{\sqrt{x^2+y^2}} \\&=\sqrt{x^2+y^2}. \end{align}$