From: Harry Kakueki Date: 2011-09-05T21:21:06+09:00 Subject: Re: Beginner needing help - Writing right-angle triangle program > > And uh, this isn't really programming, but how did you go by getting the > hypotenuse? I'm a little confused by the code :3. Thanks! > p = perimeter a**2 + b**2 = c**2 b = p-a-c a**2 + (p-a-c)**2 = c**2 a**2 + p**2 - pa - pc - ap + a**2 + ac - cp + ca + c**2 = c**2 a**2 + (p**2 - 2ap + a**2) - 2c(p-a) = 0 2c(p-a) = a**2 + (p-a)**2 2c = (a**2 + (p-a)**2) / (p-a) c = (a**2 + (p-a)**2) / 2(p-a) Harry