Finding the third side of a triangle