Help with Sunrise & Sunset formulas please

  • Context: Undergrad 
  • Thread starter Thread starter Tomfmal
  • Start date Start date
  • Tags Tags
    Formulas
Click For Summary
SUMMARY

The forum discussion centers on calculating approximate sunrise and sunset times using only the current day of the year, longitude, and latitude. Users emphasize that solar declination, which is essential for these calculations, is independent of geographic coordinates and instead depends on the Earth's axial tilt. Additionally, to accurately determine local time, knowledge of the time zone is necessary, which can be derived from longitude. A recommended resource for further understanding is the Wikipedia page on the sunrise equation.

PREREQUISITES
  • Understanding of solar declination and its significance in solar calculations
  • Familiarity with geographic coordinates: latitude and longitude
  • Knowledge of time zones and their relation to UTC
  • Basic programming skills for implementing formulas in code
NEXT STEPS
  • Research the "Sunrise Equation" on Wikipedia for detailed calculations
  • Learn how to derive time zones from longitude and latitude
  • Explore solar declination calculations and their applications
  • Investigate programming techniques for implementing astronomical formulas
USEFUL FOR

Anyone developing applications that require accurate solar event timings, such as app developers, watchface designers, and hobbyists interested in astronomy.

Tomfmal
Messages
3
Reaction score
2
TL;DR
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   Reactions: 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.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 16 ·
Replies
16
Views
8K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 25 ·
Replies
25
Views
7K
  • · Replies 4 ·
Replies
4
Views
39K
  • · Replies 8 ·
Replies
8
Views
8K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
1
Views
1K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K