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

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"

  • Comment on Re: Re: Re: Finding the hypotenuse of a right triangle!

Replies are listed 'Best First'.
Re: Re: Re: Re: Finding the hypotenuse of a right triangle!
by theorbtwo (Prior) on Apr 09, 2002 at 18:14 UTC

    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