Explanation:
Pythagoras
c² = a² + b²
with c being the Hypotenuse (the side opposite of the right angle), which is in our case the ladder.
28² = 22² + b²
784 = 484 + b²
b² = 784 - 484 = 300
b (the distance of the ladder from the wall) = 17.32050808... ft ≈ 17.3 ft