Help with Sunrise & Sunset formulas please

  • I
  • Thread starter Tomfmal
  • Start date
  • Tags
    Formulas
In summary, the equations you need to calculate sunrise and sunset are:-The time of day, in UTC-The latitude of the location-The longitude of the location-The solar declination (which is a measure of how far from the celestial equator the Sun is)
  • #1
Tomfmal
3
2
TL;DR Summary
I am looking for a formula that will give an approximate sunrise and sunset but I only have 3 bits of information to work with: The current day of the year, longitude and latitude. I'm trying to incorporate rough SR and SS into a code for a watchface. The program does have a stock SR and SS but it is locked on one area (Los Angeles, USA). This is useless to people living in all other areas. I have seen some formulas but all have more info needed such as solar angle.
Help!
I am looking for a formula that will give an approximate sunrise and sunset but I only have 3 bits of information to work with: The current day of the year, longitude and latitude. I'm trying to incorporate rough SR and SS into a code for a watchface. The program does have a stock SR and SS but it is locked on one area (Los Angeles, USA). This is useless to people living in all other areas. I have seen some formulas but all have more info needed such as solar angle.
I do have UTC time available in the program if that helps. I don't see any way to tell whether or not your local time is positive or negative in relation to the UTC. My local time is 17:07 and the UTC comes up 21:07. I live in NY, USA.
Help!
 
Astronomy news on Phys.org
  • #3
Thanks @Ibix
It says in that article: "To start the calculation we need from published tables the declination of the Sun on the day, that is how far north or south it is from the celestial equator, the projection of the equator into the sky."
Can the declination be derived from latitude and longitude?
 
  • #4
Again, google is your friend. Searching "calculate solar declination" got me here.
 
  • Like
Likes PeroK
  • #5
Tomfmal said:
Thanks @Ibix
It says in that article: "To start the calculation we need from published tables the declination of the Sun on the day, that is how far north or south it is from the celestial equator, the projection of the equator into the sky."
Can the declination be derived from latitude and longitude?
No. Solar declination has nothing to do with latitude and longitude. It is a measure of how far from the celestial equator the Sun is. This depends only on the orientation of the Earth's axis relative to the direction of the Sun, not on any particular place on Earth.

Longitude and latitude will also not be sufficient for your purposes. You will also need to know the time zone (although that could technically be derived from knowing longitude and latitude to sufficient precision).
 
  • #6
@Orodruin
Thanks, starting to make some sense. So maybe I can figure out time zone with Lat and Long. and maybe I can come with declination but when I tried the formula on the site given it was not working for me.
I should add I did spend a lot of time on Google before coming here to this forum but didn't come up with any clear formulas.
 
  • #7
Tomfmal said:
I should add I did spend a lot of time on Google before coming here to this forum but didn't come up with any clear formulas.
I programmed equations for sunrise and sunset on an HP-25 programmable calculator many years ago, with the program size restricted to 49 instructions. (Yes, I'm that old!)

I still have my notes, but instead of typing in the equations I thought of checking with duckduckgo, and was directed to an excellent Wikipedia page:
https://en.m.wikipedia.org/wiki/Sunrise_equation
If that doesn't answer your questions, I can give you some more explanations via personal message.
 

FAQ: Help with Sunrise & Sunset formulas please

What are the formulas for calculating sunrise and sunset?

The formulas for calculating sunrise and sunset can vary depending on the specific location and time zone. However, a commonly used formula is the Sunrise/Sunset Equation, which takes into account the latitude, longitude, and time of year to determine the time of sunrise and sunset. Another commonly used formula is the Zenith Angle Formula, which takes into account the elevation of the observer and the height of the sun to determine the time of sunrise and sunset.

What factors can affect the accuracy of sunrise and sunset calculations?

Several factors can affect the accuracy of sunrise and sunset calculations, including atmospheric conditions, elevation, and the curvature of the Earth. Additionally, the formulas used may not take into account factors such as daylight saving time or leap years, which can also impact the accuracy of the calculations.

How do I use the sunrise and sunset formulas to determine the length of daylight?

To determine the length of daylight, you can use the formula: Length of Day = Sunset - Sunrise. This will give you the total number of hours and minutes of daylight for a specific location and date. Keep in mind that this calculation does not take into account factors such as atmospheric conditions or the curvature of the Earth, so it may not be completely accurate.

Can I use online tools or apps to calculate sunrise and sunset times?

Yes, there are many online tools and apps available that can calculate sunrise and sunset times for a specific location and date. These tools use advanced algorithms and data sources to provide accurate calculations. However, it is always a good idea to double-check the results with another source to ensure accuracy.

Are there any limitations to using sunrise and sunset formulas?

Yes, there are some limitations to using sunrise and sunset formulas. These formulas are based on ideal conditions and may not account for factors such as cloudy or hazy weather, which can impact the actual time of sunrise and sunset. Additionally, these formulas may not be accurate for extreme latitudes or locations near the poles.

Similar threads

Replies
11
Views
2K
Replies
5
Views
4K
Replies
25
Views
4K
Replies
4
Views
4K
Replies
15
Views
3K
Replies
8
Views
2K
Back
Top