# Is there any formulae to calculate whether the sun will depress 18 degrees or more below the horizon on a certain day / location?

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!

• In other words, you're looking for the days where astronomical twilight never ends and it's never dark enough (in theory) to see 6th magnitude stars at the zenith? – user21 Jul 9 '18 at 3:09
• As noted in my astronomy.stackexchange.com/questions/14492/… the lowest altitude a celestial object reaches is abs(lat+dec)-90 degrees, where lat is the latitude in degrees (negative for southern hemisphere), and dec is the declination in degrees. You can solve this to see what solar declinations make that number greater than -18. However, this doesn't really answer your question: you can calculate solar declination to high precision, but I'd like to provide a simple approximation if I actually "answer" this question. – user21 Jul 9 '18 at 14:48
• What's your formula do with changes in latitude? – Carl Witthoft Jul 9 '18 at 17:08
• @CarlWitthoft If that was directed at me, the formula actually includes latitude as a parameter. – user21 Jul 10 '18 at 15:04
• I don't know the formula, but astropy can calculate the values. You can extract the logic from the source code if you need to. – j-g-faustus Jul 12 '18 at 11:06