There are many formulas for determining sunrise and sunset times for locations, but for my application I only need to know if it is day or night (given a time, latitude and longitude).

After studying the terms azimuth, altitude/elevation, and zenith, I am curious if I can calculate the sun's elevation, and use that value to determine day/night status alone.

As I understand it, any value below the horizon (taking into consideration the various values for twilight) should tell me that it is night. I should be able to use -6 for civil twilight, -12 for nautical twilight, etc.

Do I need to worry about azimuth also?


Yes, knowing the sun's elevation is generally enough to determine how dark it is, at least to a first approximation.

However, if you're using a simple geometric formula for the elevation, keep in mind that you may need to adjust it for atmospheric refraction. Wikipedia's sunrise article has a pretty nice explanation of this:

"Sunrise occurs before the Sun actually reaches the horizon because the Sun's image is refracted by the Earth's atmosphere. The average amount of refraction is 34 arcminutes, though this amount varies based on atmospheric conditions.

Also, unlike most other solar measurements, sunrise occurs when the Sun's upper limb, rather than its center, appears to cross the horizon. The apparent radius of the Sun at the horizon is 16 arcminutes.

These two angles combine to define sunrise to occur when the Sun's center is 50 arcminutes below the horizon, or 90.83° from the zenith."

In general, if you're just comparing the elevation to some fixed threshold, it's enough to adjust the threshold to account for this.

| cite | improve this answer | |
  • $\begingroup$ Aha, this must be why "official" twilight is 90° 50'. Thanks for the background on that! $\endgroup$ – JYelton Apr 9 '12 at 14:16

All you need is altitude. Azimuth is strictly what compass heading to look toward to hunt for the Sun.

| cite | improve this answer | |
  • $\begingroup$ Thanks! Also, phrasing it, "hunt for the Sun" I found quite funny. :) $\endgroup$ – JYelton Apr 9 '12 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.