Valhalla Legends Forums Archive | Yoni's Math Forum | Pythagorean theorem

AuthorMessageTime
ObsidianWolf
A squared + B squared = C squared

So in Programming it would be roughly

((A x A) + (B x B))/2 = C Squared?
January 22, 2004, 5:25 PM
ObsidianWolf
nm, Solved my own question by looking in earlier posts.

Pythagoras theorem: c^2 = a^2 + b^2
Trigonometry: c = a/sin(alpha) = b/sin(beta) = a/cos(beta) = b/cos(alpha)
January 22, 2004, 5:47 PM
K
And don't forget the law of cosines too! :P
triangle with sides a, b, c, each side opposite it's respective angle A, B, C.

a[sup]2[/sup] = b[sup]2[/sup] + c[sup]2[/sup] - 2bc*cos(A)

Edit: changed sign. See reply below. That's what I get for trying to do things from memory.
Edit2: changed angle. See further below. I will now hide myself in shame for even posting to begin with.
January 22, 2004, 6:21 PM
Yoni
Close enough, but it's really
a² = b² + c² - 2bc*cos(A)

The sign on the cosine is negative, and the angle in the cosine on the right of the equation is opposite the side that's squared on the left of the equation.

Edit: Note that the Pythagorean theorem can be viewed as a special case of the cosine theorem for A = 90 degrees. (Then cos(A) = 0.)
January 22, 2004, 7:24 PM
ObsidianWolf
Will your way produce any more of an accurate answer Yoni? If so Ill use that instead.
January 22, 2004, 8:08 PM
Yoni
A more accurate answer?? This isn't about accuracy or precision, it's a theorem that helps you find an expression for the ratio between parts of the triangle. You should use it if it's useful for what you're trying to solve, or something else if it's not. Accuracy or precision are a different matter, and they don't depend on the way you used to reach the solution.

Btw K, you're still taking the cosine of the wrong angle :P
January 22, 2004, 9:05 PM
ObsidianWolf
Im using it to find a value between lat longs. if the value falls in a certain range then i pass it along to mapper routine.
January 22, 2004, 9:42 PM

Search