<p>An <em>approximation</em> of the Sun’s declination for a certain date is:</p>
<p>sin δ = 0.39795 ⋅ cos [ 0.98563 ⋅ ( <em>N</em> – 173 ) ]</p>
<p>where <em>N</em> is the number of days since January 1.</p>
<p>That, combined with the formula given by @user21, viz.:</p>
<p><span class="math-container">$ a_{min} = \lvert \phi + \delta \rvert - 90° $</span></p>
<p>will give you the dates where the Sun is at least 18° under the horizon.</p>
<p>(Oddly enough, a simple instrument, invented by the Greeks almost 2,000 years ago and perfected by the Muslims over the next few centuries, the <em><strong>astrolabe</strong></em>, would give you the answer almost instantly, without having to do any calculations. Below is a photo of one I made in brass.)</p>
<p><a href="https://i.sstatic.net/kV4kT.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kV4kT.jpg" alt="Brass astrolabe, home-made by Pierre Paquette, 2020" /></a></p>

CC BY-SA 4.0
2020-11-25T04:00:55.163Z
2020-11-25T04:00:55.163Z
Pierre Paquette
<p>First see the plethora of diverse answers to <a href="https://astronomy.stackexchange.com/q/13488/7982">Where can I find the positions of the planets, stars, moons, artificial satellites, etc. and visualize them?</a></p>
<p>Then if you can use Python or would like to learn, consider using <a href="https://rhodesmill.org/skyfield/" rel="nofollow noreferrer">Skyfield</a> for everything!</p>
<p>Also have a look at <strong>Astronomical Algorithms</strong> in <a href="https://astronomy.stackexchange.com/a/18029/7982">this very long answer</a>:</p>
<blockquote>
<p>This is something you'll have to dig into a bit, but if you like to program, it may be exactly what you're looking for. The <a href="http://www.gaisma.com/en/" rel="nofollow noreferrer">Gaisma website</a> is one of my favorites on the internet - easy to use and presents a bunch of information in easy-to-understand graphics. Click around!</p>
<p>I believe that this site uses algorithms from the collection found at <a href="http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html" rel="nofollow noreferrer">this NOAA site</a>. Click around there as well. They provide Excel spreadsheets which contain the algorithms and other resources. The &quot;main&quot; resource is a collection of algorithms published in the book <a href="http://www.willbell.com/math/mc1.htm" rel="nofollow noreferrer">Astronomical Algorithms - Jean Meeus</a>. Search the books title and you can find that there are many similarly titled books. I'd recommend going to a library if possible, because it's (in my opinion) always good to go to libraries. However parts of these can be found on-line. For example, a few pages shown from the book <a href="http://www.math.harvard.edu/%7Eknill/3dprinter/exhibits/bc/Meeus1988.pdf" rel="nofollow noreferrer">Astronomical Formulae for Calculators (1988)</a> include an interesting table of contents.</p>
</blockquote>
<ul>
<li>Also see <a href="https://astronomy.stackexchange.com/a/27906/7982">https://astronomy.stackexchange.com/a/27906/7982</a></li>
</ul>

CC BY-SA 4.0
2020-11-26T01:21:11.300Z
2020-11-26T01:21:11.300Z
uhoh
<p>I'm trying to code a piece of software which will calculate some times for me that would greatly help me in my day to day but none of my formulae work if the sun doesn't go at least 18 degrees below the horizon.</p>

<p>In this case, I have different formulae to use but I need to program the software to be able to use this other formula on these days. I have no way of determining the maximum the sun will depress below the horizon on any specific day or location.</p>

<p>I am not an expert in any sense of the word in astronomy and literally only know what is relevant to what I need, but I think what I am trying to ask is if it is possible to determine the if the minimum solar elevation / altitude angle is less than -18 degrees on a day / location.</p>

<p>I have attempted to search but was unsuccessful and am even unsure if what I am asking for is even possible.</p>

<p>Thanks for any help!</p>

CC BY-SA 4.0
2018-07-09T17:08:44.760Z
What's your formula do with changes in latitude?
Carl Witthoft
CC BY-SA 4.0
2018-07-12T11:06:50.073Z
I don't know the formula, but [astropy](http://docs.astropy.org/en/stable/coordinates/solarsystem.html) can calculate the values. You can extract the logic from the source code if you need to.
j-g-faustus
<the-sun><observational-astronomy><horizon>
Is there any formulae to calculate whether the sun will depress 18 degrees or more below the horizon on a certain day / location?
15150776
# Is there any formulae to calculate whether the sun will depress 18 degrees or more below the horizon on a certain day / location?

(Asked by: username_0 on 2018-07-09)

I'm trying to code a piece of software which will calculate some times for me that would greatly help me in my day to day but none of my formulae work if the sun doesn't go at least 18 degrees below the horizon.

In this case, I have different formulae to use but I need to program the software to be able to use this other formula on these days. I have no way of determining the maximum the sun will depress below the horizon on any specific day or location.

I am not an expert in any sense of the word in astronomy and literally only know what is relevant to what I need, but I think what I am trying to ask is if it is possible to determine the if the minimum solar elevation / altitude angle is less than -18 degrees on a day / location.

I have attempted to search but was unsuccessful and am even unsure if what I am asking for is even possible.

Thanks for any help!

**Tags:** the-sun, observational-astronomy, horizon
> **Comments:**
> **username_1**: What's your formula do with changes in latitude?  
> **username_2**: I don't know the formula, but [astropy](http://docs.astropy.org/en/stable/coordinates/solarsystem.html) can calculate the values. You can extract the logic from the source code if you need to.  

---

## 2 answers

### Answer by username_3 on 2020-11-25. Score: 3

An *approximation* of the Sun’s declination for a certain date is:

sin δ = 0.39795 ⋅ cos [ 0.98563 ⋅ ( *N* – 173 ) ]

where *N* is the number of days since January 1.

That, combined with the formula given by @user21, viz.:

$ a\_{min} = \lvert \phi + \delta \rvert - 90° $

will give you the dates where the Sun is at least 18° under the horizon.

(Oddly enough, a simple instrument, invented by the Greeks almost 2,000 years ago and perfected by the Muslims over the next few centuries, the ***astrolabe***, would give you the answer almost instantly, without having to do any calculations. Below is a photo of one I made in brass.)

[![Brass astrolabe, home-made by Pierre Paquette, 2020](https://i.sstatic.net/kV4kT.jpg)](https://i.sstatic.net/kV4kT.jpg)


---

### Answer by username_4 on 2020-11-26. Score: 2

First see the plethora of diverse answers to [Where can I find the positions of the planets, stars, moons, artificial satellites, etc. and visualize them?](https://astronomy.stackexchange.com/q/13488/7982)

Then if you can use Python or would like to learn, consider using [Skyfield](https://rhodesmill.org/skyfield/) for everything!

Also have a look at **Astronomical Algorithms** in [this very long answer](https://astronomy.stackexchange.com/a/18029/7982):

> This is something you'll have to dig into a bit, but if you like to program, it may be exactly what you're looking for. The [Gaisma website](http://www.gaisma.com/en/) is one of my favorites on the internet - easy to use and presents a bunch of information in easy-to-understand graphics. Click around!
>
> I believe that this site uses algorithms from the collection found at [this NOAA site](http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html). Click around there as well. They provide Excel spreadsheets which contain the algorithms and other resources. The "main" resource is a collection of algorithms published in the book [Astronomical Algorithms - Jean Meeus](http://www.willbell.com/math/mc1.htm). Search the books title and you can find that there are many similarly titled books. I'd recommend going to a library if possible, because it's (in my opinion) always good to go to libraries. However parts of these can be found on-line. For example, a few pages shown from the book [Astronomical Formulae for Calculators (1988)](http://www.math.harvard.edu/%7Eknill/3dprinter/exhibits/bc/Meeus1988.pdf) include an interesting table of contents.

* Also see <https://astronomy.stackexchange.com/a/27906/7982>


---

