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).
  • 2
    What do you mean by "equivalent" here? What do you mean by "generalized"?2012-05-22
  • 2
    Isn't $\cos(\tan^{-1}(y/x))$ always equal to $x\over\sqrt{x^2 + y^2}$ whenever $x\ne 0$? If so, it seems to me that you haven't avoided the squaring and rooting so much as you've swept them under a trigonometric carpet.2012-05-22
  • 0
    @MarkDominus I disagree. It depends which one you take as fundamental. Obviously trigonometry and squares are closely related, and obviously you can always transform one into the other, but I'd like to try to derive the Pythagorean theorem from the trig instead of the (more common) inverse. But yes, obviously, the above should reduce to a generalized case of the Pythagorean theorem.2012-05-22
  • 0
    @QiaochuYuan it seems unnatural to me that triangular distances are found by extrapolating squares, adding them, and then rooting them. I'm trying to do the same thing but with trig. So by "equivalent" I mean "identical given Cartesian coordinates." By "generalized" I mean this: The Pythagorean theorem works in three-dimensional space. How do you add a z dimension to $x*cos(tan^{-1}(y/x)) + y*cos(tan^{-1}(x/y))$?2012-05-22
  • 2
    @Nate: why does that seem unnatural to you?2012-05-22
  • 0
    I don't mean to be snarky, but I don't understand why you consider your approach preferable to saying that $d(x,y) = e^{\frac12\log{\left(e^{2\log x} + e^{2\log y}\right) }}$, which also eliminates the squaring and the rooting in what seems to me to introduce similarly pointless complications.2012-05-22
  • 0
    @MarkDominus I'm not asking you to understand why I prefer my approach.2012-05-22
  • 0
    Sorry; I hope I did not derail the discussion.2012-05-22
  • 0
    @QiaochuYuan: d=(√x2+y2) basically says "in order to find d, extrapolate x and y into squares, mush the squares together into one big square, and then measure a side of the new square." I understand why it works, but it seems a coincidental (not fundamental) way to find distance. (Whereas x*cos(Y)+y*cos(X) is the projection of the x and y axes onto the axis of the distance, that's a very straightforward way of finding it.) Regardless, I'm not asking you to empathize with my curiosity: merely to help me out with my questions.2012-05-22
  • 0
    @MarkDominus No problem. The reason I'm interested is a more-than-600-character rabbit hole. Succinctly, I'm wondering why the Pythagorean theorem occurs. (Why are squares so closely related to measuring distance? What do the squares of the sides have to do with anything?) When I ask, people tend to show me proofs, which is the "how", not the "why", so I'm working through it from another direction. To me it seems that the Pythagorean theorem is emergent from a special case of the cosine rule and that projecting sides onto the axis of distance is a more fundamental way of measuring distance.2012-05-22
  • 0
    I'm not sure what you mean in the second sentence with "from the cosine rule". That formula follows quickly from the definition of cosine if you add a segment from $C$ perpendicular to $c$.2012-05-22
  • 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