I Help with Sunrise & Sunset formulas please

  • I
  • Thread starter Thread starter Tomfmal
  • Start date Start date
  • Tags Tags
    Formulas
AI Thread Summary
The discussion centers on finding a formula for calculating sunrise and sunset times using only the current day of the year, longitude, and latitude. The user seeks to incorporate these calculations into a watchface application, as existing stock formulas are limited to Los Angeles. It is noted that solar declination, essential for these calculations, is independent of latitude and longitude and depends on the Earth's axial orientation. Additionally, determining the local time zone from longitude and latitude is suggested as a potential solution. The conversation highlights the challenges in finding clear formulas and resources for accurate sunrise and sunset calculations.
Tomfmal
Messages
3
Reaction score
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
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?
 
Again, google is your friend. Searching "calculate solar declination" got me here.
 
  • Like
Likes PeroK
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).
 
@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.
 
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.
 
Back
Top