Formula for sunset/rise times, moonrise/set and phases

In summary, the person is asking for help with designing a website where they want to present information about sunrise, sunset, moonrise, and set. They mention that the formulas are probably quite difficult but that they hope someone can help them. They also mention that they don't know much about maths and that they are surprised that the moon calculations are more complex. The person asks for help with sunrise, sunset, moonrise, and set times and twilight, dawn, and darkness.
  • #1
Goats Dont Shave
3
0
Hello Everyone,
I am currently designing project where part of it will involve a website and amoungst things, on the site I would like present the time for sunrise and set for the current day and the same for moonrise and set as well as the current lunar phase. This is for a college project and I would prefer if someone could give me a formula/algorithm for any of them. I know there is code out there on the net but I can't just copy and paste this. I would feel comfortable writing the code to carry out any of the formulas you might have.

I think the formulas are probably quite difficult but would it not be true that the sunrise and sunset time will change by a fixed amount each day. for example if i know the sunrise time for my location on 1 august 2004 is it just a matter of adding on a certain amount of minutes and seconds each day until a certain date when the it will begin to rise earlier? this is probably a bit too good to be true?

Could the same apply for moonrise/set times?

Would the same type of method apply for the lunar phases? We know that the moon orbits Earth every 29.6 days so is it just a matter of working out when the last full moon was, let's say it was 1 august we now know that next one will be 29.6 days later. so if someone comes along on august 15 the program could then work out the percentage of the moon showing and give a good estimate of the phase. similarily if someone comes along in december then the program could start from 1 august and then calculate the phase and % for that day. Does anybody think this would work or is there an accurate formula out there?

Also does anybody know when darkness officailly starts? how long after sunset? same for twilight, dawn etc?

Thanks for any help anybody might have.

PS i hope I posted this on the correct forum. If you think it is better suited to one of the maths forum please say.
Thanks again
goats
 
Astronomy news on Phys.org
  • #2
The sunrise and sunset times depend on the latitude. The simplest way is to calculate time of local apparent noon and length of apparent day from the astronomical triangle with sun's declenson (by date, from ephemeris) and colatitude as two of the legs and 180o (noon) as the included angle, using the spherical trig cosine theorem. The third leg will be the hour angle, from which the time can be calculated. Then you subtract half the day length from noon to get the raw sunrise time and adding it to get raw sunset time. Then these have to be corrected for refraction, etc (a fixed calc), and there you are. The Moon times are MUCH more difficult, and probably should be calculated from finite differences.
 
  • #3
Thanks selfadjont for a quick reply,
I'm not really a big maths man and am not familiar with the astronomical triangle. what is this and how do I use it? Is it difficult to use? You make it sound simple but you have me totally lost!

Also I'm surprised that the moon calculations are more complex again. Was my suggestion in the original message too optimistic or do I have the basic idea?

Also I don't understand finite differences, never came across it. My background is electronics more so than maths.

thanks
 

What is the formula for calculating sunset and sunrise times?

The formula for calculating sunrise and sunset times is based on the Earth's rotation and the position of the Sun. The formula takes into account the latitude, longitude, and time of year to determine the exact time of sunrise and sunset.

How is the moonrise and moonset time calculated?

The moonrise and moonset times are calculated using the same formula as sunrise and sunset, but taking into account the position of the Moon in relation to the Earth. This formula also considers the phase of the Moon and the observer's location on Earth.

What factors affect the accuracy of the calculated times?

The accuracy of the calculated times can be affected by several factors, such as the accuracy of the observer's location, atmospheric conditions, and any changes in the Earth's rotation or the Moon's orbit. These factors can cause slight variations in the calculated times.

How accurate are the calculated times?

The calculated times for sunset, sunrise, moonrise, and moonset are generally accurate to within a few minutes. However, as mentioned before, external factors can cause slight variations in the actual times.

Can the formula be used to predict the exact time of a specific phase of the Moon?

No, the formula for calculating sunset, sunrise, moonrise, and moonset times cannot predict the exact time of a specific phase of the Moon. This is because the Moon's orbit is not perfectly circular and can vary slightly in its distance from the Earth, causing variations in the time of the Moon's phases.

Similar threads

  • Astronomy and Astrophysics
Replies
6
Views
1K
  • Astronomy and Astrophysics
Replies
11
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Astronomy and Astrophysics
Replies
5
Views
3K
  • Astronomy and Astrophysics
Replies
25
Views
1K
  • Astronomy and Astrophysics
Replies
22
Views
2K
  • Earth Sciences
Replies
25
Views
2K
  • Astronomy and Astrophysics
Replies
4
Views
1K
  • Astronomy and Astrophysics
Replies
10
Views
2K
Replies
2
Views
599
Back
Top