Help with Sunrise & Sunset formulas please

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

Discussion Overview

The discussion revolves around finding a formula to calculate approximate sunrise and sunset times using limited information: the current day of the year, longitude, and latitude. Participants explore the feasibility of deriving necessary parameters like solar declination and time zone from the available data, with a focus on practical implementation for a watchface application.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks a formula for sunrise and sunset times based on day of the year, longitude, and latitude, noting the limitations of existing stock formulas tied to a specific location.
  • Another participant suggests that solar declination is necessary for calculations and questions whether it can be derived from latitude and longitude.
  • A different participant asserts that solar declination is independent of latitude and longitude, emphasizing that it is determined by the Earth's axial tilt relative to the Sun.
  • Some participants discuss the potential to derive time zone information from latitude and longitude, although this remains uncertain.
  • A participant shares their past experience programming sunrise and sunset equations and references a Wikipedia page for further information.

Areas of Agreement / Disagreement

Participants express differing views on the sufficiency of latitude and longitude for calculating solar declination and time zone, indicating that multiple competing perspectives remain unresolved.

Contextual Notes

Participants note the limitations of their available data and the complexity of deriving certain parameters necessary for accurate calculations, highlighting the dependence on additional information not readily available.

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
9K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 25 ·
Replies
25
Views
8K
  • · Replies 4 ·
Replies
4
Views
39K
  • · Replies 8 ·
Replies
8
Views
8K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
1
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K