in reply to Re: Finding the hypotenuse of a right triangle!
in thread Finding the hypotenuse of a right triangle!

Actually, A and B are the same mathematically, not B and C. If I leave the dash out, how is the user supposed to tell the program the 12 5 means A & B, or A & C, or B & C?

Oh, about the first point (not needing to know what the hypotenuse of a triangle is). I'm 13 years old, and I'm in a national math competition called Mathcount. This year our team got to states, coming first at regionals. I eat sleep and breathe math. Read more on my team and mathcounts here (an entry in my blog).

> munchie, the number munchin newb
Llama: The other other white meat!
(you had to be there :-P)

Replies are listed 'Best First'.
Re: Re: Re: Finding the hypotenuse of a right triangle!
by belg4mit (Prior) on Apr 09, 2002 at 00:07 UTC
    It's simply a matter of how you label them (yes the usual is a**2 + b**2 = c**2, but they're variables so the names don't really matter). Anyways, that kind of goes to the point of the picture not being very discernible in it's current state.

    With your side notation you only need two cases A & B or A & C. Traditionally in such cases one uses switches, see Getopt::Std (among others).

    PS> I didn't say there was no point in knowing what a hypotenuse was. I just joked that it's not something one is often called upon to find. --
    perl -pe "s/\b;([mnst])/'\1/mg"

      It's true that generaly you use a switch-argument semantic for command-line arguments. However, that doesn't always make it the easiest way. IMHO, it's a lot easier to say pythag 3 - 5 then pythag -o 3 5 (to find an "other" side of the triangle -- B given A and C).


      We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book