use pythagorean theorem to solve for a right triangle