The building forms a right angle with the ground, so we have a right triangle formed by the building, the ground, and the ladder.
let x = length of the ladder; then x - 16 = the length from the base of the ladder to the building, and x - 8 = height of the building
we will use the Pythagorean theorem that c2 = a2 + b2 where c = hypotenuse of a right triangle
in this case, x2 = (x - 8)2 + (x - 16)2
expanding, we get x2 = x2 -16x + 64 + x2 - 32x + 256
combining, we get 0 = x2 - 48x + 320
this expression can be factored into (x - 8)(x- 40)
so, our roots are 8 and 40
but 8 will not function as a root, so it must be discarded,
therefore x = 40; so, x - 8 = 32, and x - 16 = 24
∴ the length of the ladder is 40, the height of the building is 32, the length of the base is 24
Proof: 402 = 322 + 242; 1600 = 1024 + 576; 1600 = 1600