In 1021, Alhazen showed that atmospheric refraction is also responsible for twilight in Opticae thesaurus ; he estimated that twilight begins when the sun is 19 degrees below the horizon, and also used a geometric determination based on this to estimate the maximum possible height of the Earth's atmosphere as 52,000 passim (about 49 miles, or 79 km).