<p>What you ask for doesn't exist.  The IAU has not adopted any particular formula.</p>
<p>If you are getting different answers from the implementation in the book then your implementation is wrong (or the book's implementation is wrong)</p>
<p>If you are getting different answers from those on the internet, there are several possible reasons. Differences like the ones you see here may be the result of:</p>
<ul>
<li>Different choice of atmospheric parameters (how much refraction)</li>
<li>Different definition of &quot;sunrise&quot;  (upper limb touching horizon vs centre vs lower limb)</li>
<li>Different model.  As far as I'm aware, <strong>the IAU doesn't do solar system models</strong>, but NASA do. Their model is called DE440 it is based on numerical integration of the planets' movements. Another is called VSOP (it was created by the French Bureau de Longitudes)  and is based on proper Keplarian elements. However both achieve sub milli-arcsecond accuracy, so can't account for differences of a minute or more. USNO also publish ephemeris.</li>
<li>Failing to use the model correctly for example calculating the solar RA/Dec at 00:00 on the day in question, and then finding when that point crosses the horzion.</li>
</ul>
<p>Of the various uncertainties, the one that I think is most likely to be causing the variation is the atmospheric model, as this has a significant effect on rise times and is genuinely variable.</p>
<p>As for the algorithms found in the calculators, you can read their javascript source.  For example the satellite site uses the algorithm at <a href="http://www.stjarnhimlen.se/comp/riset.html" rel="nofollow noreferrer">http://www.stjarnhimlen.se/comp/riset.html</a></p>

CC BY-SA 4.0
2021-12-22T14:13:51.077Z
Nobody sane does sunrise / sunset to the second because atmospheric conditions can make sunrise / sunset time change by over a minute.
David Hammen
CC BY-SA 4.0
2021-12-22T14:14:36.173Z
Re *Another is called VSOP (it was created by the French Bureau de Longitudes) and is based on osculating Keplarian elements*. That's icorrect. The VSOP is based on "proper elements". Osculating elements are pretty much worthless.
David Hammen
CC BY-SA 4.0
2021-12-23T07:59:00.837Z
Thanks but I am asking about the formulas adopted by the IAU.
VansFannel
CC BY-SA 4.0
2021-12-23T09:49:47.400Z
An IAU approved algorithm doesn't exist.  I'll edit to make that clear.
James K
CC BY-SA 4.0
2021-12-23T12:24:55.607Z
But even so, your answer doesn't answer my question.
VansFannel
CC BY-SA 4.0
2021-12-23T22:16:04.567Z
Well, I think it does answer your question.  If you ask for the name of a green elephant and I answer that green elephants don't exist, I've answered your question.
James K
CC BY-SA 4.0
2021-12-22T09:56:53.743Z
2021-12-23T11:12:39.243Z
2021-12-23T11:12:39.243Z
James K
<p>James K mentioned one possible source of difference: calculating the Sun's position at one time and using that position to calculate the sunrise and sunset. When I do that with my own code, I get these results:</p>
<ul>
<li>Sun's position at 0 hr Eastern time (5 hr UT)</li>
<li>Rise: 6:03</li>
<li>Set: 17:42</li>
</ul>
<p>When I include the Sun's motion during the day, I get these results:</p>
<ul>
<li>Sun's position interpolated to time of rise/set</li>
<li>Rise: 6:04</li>
<li>Set: 17:46</li>
</ul>
<p>My position of the Sun is based on this reference: Jean Meeus, Astronomical Formulae For Calculators, 4th Edition, 1988.</p>
<p>As mentioned in a comment, differences of a minute are not too significant due to the variability of the real event.</p>

CC BY-SA 4.0
2021-12-23T07:58:31.880Z
I have implemented the previous 48 formulas and, in all of them, I get the same result. Now, I don't, so there is a problem with the formula or with my implementation. This is why I am asking: *"Where can I find those formulas?"* And nobody has answered that question yet.
VansFannel
CC BY-SA 4.0
2021-12-23T18:59:09.957Z
I do not have the Duffett-Smith book, but I assume it uses the standard method of finding the time when the Sun is 0.833 degrees below the horizon. The details of the method are in many sources such as the Jean Meeus book and the Astronomical Almanac. You can also use the other formulas in the Duffett-Smith book to check if your time is correct! Also, if your code is the same as in the book but gives different results than the book, then the result in the book is wrong. (You should be happy if your results are within a minute of JPL Horizon's website.)
JohnHoltz
CC BY-SA 4.0
2021-12-23T19:28:28.410Z
My results are within less than a minute with the *Apparent RA & DEC*.
VansFannel
CC BY-SA 4.0
2021-12-24T03:10:03.497Z
@Vans If your RA & DEC are good, then I suppose you need a better model for the [figure of the Earth](https://en.wikipedia.org/wiki/Figure_of_the_Earth). Also see the various definitions of [latitude](https://en.wikipedia.org/wiki/Latitude).
PM 2Ring
CC BY-SA 4.0
2021-12-22T20:38:25.603Z
2021-12-22T20:38:25.603Z
JohnHoltz
<p>Answering your main question: if you were to correct the text in the book you would word it differently, deleting all the mentions of parallax except for a single sentence saying there is such a thing but it's negligible for calculating the Sun's rise and set time. No one's going to run aground because of that small a correction, or even notice it, so it's not worthy of being reworded or mentioned in a future errata list.</p>
<p>Then, for your C++ library, someplace in your documentation, you should say that the major uncertainty is refraction. &quot;34 arcminutes&quot; is what you'd see if the center of the pupils of your eyes were exactly at sea level. If they weren't (they never are), you'd have to adjust, reduce, the correction factor, and you'd have to add in the dip correction which is part geometry and part a second refraction correction. Both of those factors need to be adjusted for temperature and atmospheric pressure. Don't go there. Don't try to be that precise. No one cares much about the exact minute the Sun peeks above the horizon. The various twilight times are more important, giving an idea of what you can do before sunrise and after sunset.</p>

CC BY-SA 4.0
2022-01-02T05:05:56.463Z
2022-01-02T05:05:56.463Z
stretch
<p>The IAU does provide a C library called &quot;Standards of Fundamental Astronomy&quot; at <a href="http://www.iausofa.org/" rel="nofollow noreferrer">http://www.iausofa.org/</a> which states &quot;The principal function of the SOFA Astronomy Library is to provide definitive algorithms&quot; (on <a href="http://www.iausofa.org/2021_0512_C/sofa/sofa_lib.lis" rel="nofollow noreferrer">http://www.iausofa.org/2021_0512_C/sofa/sofa_lib.lis</a>).</p>
<p>The library even includes limited-precision Ephemerides under the &quot;Ephemerides (limited precision)&quot; section of the same link: <a href="http://www.iausofa.org/2021_0512_C/sofa/sofa_lib.lis" rel="nofollow noreferrer">http://www.iausofa.org/2021_0512_C/sofa/sofa_lib.lis</a></p>
<p>However, they don't provide a definitive formula for sunrise/sunset.</p>
<p>You might be thinking of the SPICE libraries at <a href="https://naif.jpl.nasa.gov/naif/aboutspice.html" rel="nofollow noreferrer">https://naif.jpl.nasa.gov/naif/aboutspice.html</a> which should give you the same precision as NASA's official computations at <a href="https://gml.noaa.gov/grad/solcalc/" rel="nofollow noreferrer">https://gml.noaa.gov/grad/solcalc/</a></p>
<p>The page above also links to <a href="https://gml.noaa.gov/grad/solcalc/calcdetails.html" rel="nofollow noreferrer">https://gml.noaa.gov/grad/solcalc/calcdetails.html</a> which provides a simpler formula, but notes that it's fairly inaccurate.</p>
<p>Finally, you may want to visit <a href="http://astronomy.stackexchange.com/questions/13488/">Where can I find the positions of the planets, stars, moons, artificial satellites, etc. and visualize them?</a> which lists many other resources</p>

CC BY-SA 4.0
2021-12-24T22:54:29.917Z
2021-12-24T22:54:29.917Z
Barry Carter
<p>I'm developing a C++ computer library with the formulas in the book &quot;<a href="https://rads.stackoverflow.com/amzn/click/com/B00E3UR5FQ" rel="nofollow noreferrer" rel="nofollow noreferrer">Practical Astronomy with your Calculator or Spreadsheet 4th Edition</a>&quot; but I have a problem with the formula 49, &quot;Sunrise and sunset&quot;: I don't get the same results than in the book.</p>
<p>The example in the book say:</p>
<blockquote>
<p>Calculate the times of sunrise and sunset (upper limb) over a level
horizon at sea-level on 10 March 1986, as observed from Boston,
Massachusetts, at longitude 71.05º W and latitude 42.37º N. We shall
take the Sun's angular diameter to be 0.533 degrees, its horizontal
parallax to be 8.79 arcseconds, and the refraction due the atmosphere
as 34 arcminutes and, having added on half of the Sun's angular
diameter and a small correction for parallax, we arrive at a total
vertical shift at the horizon of the upper limb of 0.833333 degrees.
The time zone correction is -5 hours.</p>
</blockquote>
<p>In the book:</p>
<pre><code>Rise: 6h 6m 0s
Set:  17h 43m 0s
</code></pre>
<p>With my implementation:</p>
<pre><code>Rise: 6h 4m 2.98s
Set:  17h 39m 41.28s
</code></pre>
<p>I've been searching to find online calculator to check if the book is wrong or I am wrong. I've found some but I can't get any conclusion because each of them returns a different value; i.e, if I have tried three, I get three different values for sunset and sunrise.</p>
<p>So, I have searched to find the formulas that these online calculator uses without success. I've been searching for the formulas adopted by the IAU but, again, without success.</p>
<p><strong>Where can I find those formulas?</strong></p>
<p>The online calculators are:</p>
<p><a href="https://www.satellite-calculations.com/" rel="nofollow noreferrer">https://www.satellite-calculations.com/</a></p>
<p><a href="https://clearskytonight.com/projects/astronomycalculator/sun/sunrisesunset.html" rel="nofollow noreferrer">https://clearskytonight.com/projects/astronomycalculator/sun/sunrisesunset.html</a></p>
<p><a href="https://www.neoprogrammics.com/de405_usno_ae98/DE405_Sun.php" rel="nofollow noreferrer">https://www.neoprogrammics.com/de405_usno_ae98/DE405_Sun.php</a></p>
<p><a href="https://ssd.jpl.nasa.gov/horizons.cgi" rel="nofollow noreferrer">https://ssd.jpl.nasa.gov/horizons.cgi</a></p>
<p><strong>UPDATE</strong><BR/></p>
<p>I repeat my question because it seems that there is something that it is misunderstood:</p>
<p><strong>Where can I find the formulas adopted by the IAU?</strong></p>

CC BY-SA 4.0
2021-12-21T21:27:07.593Z
Can you link to the three online calculators that you are using?
James K
CC BY-SA 4.0
2021-12-22T01:47:42.227Z
Here is one written in Javascript, so you can walk through the code. https://celestialprogramming.com/risesetalgorithm.html
Greg Miller
CC BY-SA 4.0
2021-12-22T04:11:14.313Z
What is the input and the output from your program and the three references? Did you enter the longitude correct in all cases? Some references use a positive value for eastern longitude and some use a positive value for western longitude.
JohnHoltz
CC BY-SA 4.0
2021-12-22T05:46:28.753Z
@JohnHoltz I have updated my question. Yes, I have entered the correct value (positive or negative) for the longitude and latitude.
VansFannel
CC BY-SA 4.0
2021-12-22T05:57:15.100Z
@JamesK I have updated my question
VansFannel
CC BY-SA 4.0
2021-12-22T09:12:14.637Z
That USNO ephemeris is pretty old. Horizons currently uses DE440/441. Duffet-Smith's formulas are pretty good, but they're using traditional analytic methods, so the results will be different to what comes from the JPL DEs, which actually integrate the equations of motion, incorporating relativistic effects, with the results fitted to ground & space-based observations.
PM 2Ring
CC BY-SA 4.0
2021-12-23T08:21:55.363Z
You might like to look at this article on calculating the Equation of Time by Hughes, Yallop, & Hohenkerk (1989) . https://academic.oup.com/mnras/article/238/4/1529/1037665#92137115 I was playing around with that stuff earlier this year, and noticed some minor differences with the constants used by Duffet-Smith.
PM 2Ring
CC BY-SA 4.0
2021-12-23T09:11:37.960Z
There is no "IAU approved" formula (nor is there a need for that).
planetmaker
CC BY-SA 4.0
2021-12-23T09:47:34.223Z
The IAU doesn't produce, or adopt formulae, algorithms or ephermides.  Why do you suppose that they do?
James K
<the-sun><algorithm>
Sunset and sunrise formulas adopted by IAU
VansFannel
# Sunset and sunrise formulas adopted by IAU

(Asked by: username_0 on 2021-12-21)

I'm developing a C++ computer library with the formulas in the book "Practical Astronomy with your Calculator or Spreadsheet 4th Edition" but I have a problem with the formula 49, "Sunrise and sunset": I don't get the same results than in the book.
The example in the book say:

Calculate the times of sunrise and sunset (upper limb) over a level
horizon at sea-level on 10 March 1986, as observed from Boston,
Massachusetts, at longitude 71.05º W and latitude 42.37º N. We shall
take the Sun's angular diameter to be 0.533 degrees, its horizontal
parallax to be 8.79 arcseconds, and the refraction due the atmosphere
as 34 arcminutes and, having added on half of the Sun's angular
diameter and a small correction for parallax, we arrive at a total
vertical shift at the horizon of the upper limb of 0.833333 degrees.
The time zone correction is -5 hours.

In the book:
Rise: 6h 6m 0s
Set:  17h 43m 0s

With my implementation:
Rise: 6h 4m 2.98s
Set:  17h 39m 41.28s

I've been searching to find online calculator to check if the book is wrong or I am wrong. I've found some but I can't get any conclusion because each of them returns a different value; i.e, if I have tried three, I get three different values for sunset and sunrise.
So, I have searched to find the formulas that these online calculator uses without success. I've been searching for the formulas adopted by the IAU but, again, without success.
Where can I find those formulas?
The online calculators are:
https://www.satellite-calculations.com/
https://clearskytonight.com/projects/astronomycalculator/sun/sunrisesunset.html
https://www.neoprogrammics.com/de405_usno_ae98/DE405_Sun.php
https://ssd.jpl.nasa.gov/horizons.cgi
UPDATE
I repeat my question because it seems that there is something that it is misunderstood:
Where can I find the formulas adopted by the IAU?

**Tags:** the-sun, algorithm

> **Comments:**
> **username_1**: Can you link to the three online calculators that you are using?  
> **username_2**: Here is one written in Javascript, so you can walk through the code. https://celestialprogramming.com/risesetalgorithm.html  
> **username_3**: What is the input and the output from your program and the three references? Did you enter the longitude correct in all cases? Some references use a positive value for eastern longitude and some use a positive value for western longitude.  
> **username_0**: @username_3 I have updated my question. Yes, I have entered the correct value (positive or negative) for the longitude and latitude.  
> **username_0**: @JamesK I have updated my question  
> **username_4**: That USNO ephemeris is pretty old. Horizons currently uses DE440/441. Duffet-Smith's formulas are pretty good, but they're using traditional analytic methods, so the results will be different to what comes from the JPL DEs, which actually integrate the equations of motion, incorporating relativistic effects, with the results fitted to ground & space-based observations.  
> **username_4**: You might like to look at this article on calculating the Equation of Time by Hughes, Yallop, & Hohenkerk (1989) . https://academic.oup.com/mnras/article/238/4/1529/1037665#92137115 I was playing around with that stuff earlier this year, and noticed some minor differences with the constants used by Duffet-Smith.  
> **username_5**: There is no "IAU approved" formula (nor is there a need for that).  
> **username_1**: The IAU doesn't produce, or adopt formulae, algorithms or ephermides.  Why do you suppose that they do?  

---

## 4 answers

### Answer by username_8 on 2021-12-24. Score: 4 | Accepted answer

The IAU does provide a C library called "Standards of Fundamental Astronomy" at <http://www.iausofa.org/> which states "The principal function of the SOFA Astronomy Library is to provide definitive algorithms" (on <http://www.iausofa.org/2021_0512_C/sofa/sofa_lib.lis>).

The library even includes limited-precision Ephemerides under the "Ephemerides (limited precision)" section of the same link: <http://www.iausofa.org/2021_0512_C/sofa/sofa_lib.lis>

However, they don't provide a definitive formula for sunrise/sunset.

You might be thinking of the SPICE libraries at <https://naif.jpl.nasa.gov/naif/aboutspice.html> which should give you the same precision as NASA's official computations at <https://gml.noaa.gov/grad/solcalc/>

The page above also links to <https://gml.noaa.gov/grad/solcalc/calcdetails.html> which provides a simpler formula, but notes that it's fairly inaccurate.

Finally, you may want to visit [Where can I find the positions of the planets, stars, moons, artificial satellites, etc. and visualize them?](http://astronomy.stackexchange.com/questions/13488/) which lists many other resources


---

### Answer by username_1 on 2021-12-22. Score: 2

What you ask for doesn't exist. The IAU has not adopted any particular formula.

If you are getting different answers from the implementation in the book then your implementation is wrong (or the book's implementation is wrong)

If you are getting different answers from those on the internet, there are several possible reasons. Differences like the ones you see here may be the result of:

* Different choice of atmospheric parameters (how much refraction)
* Different definition of "sunrise" (upper limb touching horizon vs centre vs lower limb)
* Different model. As far as I'm aware, **the IAU doesn't do solar system models**, but NASA do. Their model is called DE440 it is based on numerical integration of the planets' movements. Another is called VSOP (it was created by the French Bureau de Longitudes) and is based on proper Keplarian elements. However both achieve sub milli-arcsecond accuracy, so can't account for differences of a minute or more. USNO also publish ephemeris.
* Failing to use the model correctly for example calculating the solar RA/Dec at 00:00 on the day in question, and then finding when that point crosses the horzion.

Of the various uncertainties, the one that I think is most likely to be causing the variation is the atmospheric model, as this has a significant effect on rise times and is genuinely variable.

As for the algorithms found in the calculators, you can read their javascript source. For example the satellite site uses the algorithm at <http://www.stjarnhimlen.se/comp/riset.html>

> **Comments:**
> **username_6**: Nobody sane does sunrise / sunset to the second because atmospheric conditions can make sunrise / sunset time change by over a minute.  
> **username_6**: Re *Another is called VSOP (it was created by the French Bureau de Longitudes) and is based on osculating Keplarian elements*. That's icorrect. The VSOP is based on "proper elements". Osculating elements are pretty much worthless.  
> **username_0**: Thanks but I am asking about the formulas adopted by the IAU.  
> **username_1**: An IAU approved algorithm doesn't exist.  I'll edit to make that clear.  
> **username_0**: But even so, your answer doesn't answer my question.  
> **username_1**: Well, I think it does answer your question.  If you ask for the name of a green elephant and I answer that green elephants don't exist, I've answered your question.  

---

### Answer by username_3 on 2021-12-22. Score: 1

username_1 mentioned one possible source of difference: calculating the Sun's position at one time and using that position to calculate the sunrise and sunset. When I do that with my own code, I get these results:

* Sun's position at 0 hr Eastern time (5 hr UT)
* Rise: 6:03
* Set: 17:42

When I include the Sun's motion during the day, I get these results:

* Sun's position interpolated to time of rise/set
* Rise: 6:04
* Set: 17:46

My position of the Sun is based on this reference: Jean Meeus, Astronomical Formulae For Calculators, 4th Edition, 1988.

As mentioned in a comment, differences of a minute are not too significant due to the variability of the real event.

> **Comments:**
> **username_0**: I have implemented the previous 48 formulas and, in all of them, I get the same result. Now, I don't, so there is a problem with the formula or with my implementation. This is why I am asking: *"Where can I find those formulas?"* And nobody has answered that question yet.  
> **username_3**: I do not have the Duffett-Smith book, but I assume it uses the standard method of finding the time when the Sun is 0.833 degrees below the horizon. The details of the method are in many sources such as the Jean Meeus book and the Astronomical Almanac. You can also use the other formulas in the Duffett-Smith book to check if your time is correct! Also, if your code is the same as in the book but gives different results than the book, then the result in the book is wrong. (You should be happy if your results are within a minute of JPL Horizon's website.)  
> **username_0**: My results are within less than a minute with the *Apparent RA & DEC*.  
> **username_4**: @Vans If your RA & DEC are good, then I suppose you need a better model for the [figure of the Earth](https://en.wikipedia.org/wiki/Figure_of_the_Earth). Also see the various definitions of [latitude](https://en.wikipedia.org/wiki/Latitude).  

---

### Answer by username_7 on 2022-01-02. Score: 0

Answering your main question: if you were to correct the text in the book you would word it differently, deleting all the mentions of parallax except for a single sentence saying there is such a thing but it's negligible for calculating the Sun's rise and set time. No one's going to run aground because of that small a correction, or even notice it, so it's not worthy of being reworded or mentioned in a future errata list.

Then, for your C++ library, someplace in your documentation, you should say that the major uncertainty is refraction. "34 arcminutes" is what you'd see if the center of the pupils of your eyes were exactly at sea level. If they weren't (they never are), you'd have to adjust, reduce, the correction factor, and you'd have to add in the dip correction which is part geometry and part a second refraction correction. Both of those factors need to be adjusted for temperature and atmospheric pressure. Don't go there. Don't try to be that precise. No one cares much about the exact minute the Sun peeks above the horizon. The various twilight times are more important, giving an idea of what you can do before sunrise and after sunset.


---

