If a person is walking in a pool, why do his legs appear shorter in water?

Due to refraction, light bends when it moves from water to air, making the legs appear at a different position, causing an optical illusion of shorter legs.