# Calculating sunrise/sunset times

#### ScienceMan

I'm not sure if this is in the right forum but I assume someone in charge can move move it if it's not. Anyway, is there an equation or algorithm or something I can use to calculate the sunrise/sunset times at a given latitude/longitude on a given day of the year (or possibly something that would give me declination so I can put zero in and solve)? I know the basics of how it works (more extreme day lengths around the solstices and at higher latitudes and the sun not rising/setting at particularly high latitudes around the solstices, etc.) but I was wondering if there was a mathematical way to figure it out. I'm also aware that there are other things that go into it but I just need what I mentioned for my purposes.

Related Earth Sciences News on Phys.org

Mentor

#### Helios

While this is going, I can give this equation which tells where ( angle ) the Sun rises ( or sets ), north or south of due East ( or west).
sin D = cos L sin ( ANGLE )
D= declination L=latitude
Now we have the when and where.

#### Rob Saunders

Petter Duffett-Smith wrote a book, Practical Astronomy With Your Calculator which includes algorithms for calculating sunrise and sunset, and many other astronomical events. A later version with co-author Jonathan Zwart includes instructions on using spreadsheets to calculate events. I used the former version several decades ago to write programs in Basic. It was entertaining then, archaic today, but the logic is the same.

#### tfr000

Petter Duffett-Smith wrote a book, Practical Astronomy With Your Calculator
Or look up the works of Jean Meeus. He's written several books on astronomical calculation.