Length of Day
Formulae
The actual day of year and the latitude (0° at the equator to 90° at the North pole) both influence the length of the day.
The perceived way of the sun around the planet can be viewed at as the boundary circle of the planet's disc. However, this constellation (in which the sun apparently circles along the disc's boundary) applies only at equinoxes and only at the North pole. The further away one is from the North pole (towards the equator), the more the surrounding circle is tilted along the West-East axis, until it is completely upright (perpendicular to the planet's disc) at the equator.
Furthermore, there is also a shift of the circle away from the disc, along the obliquity of the ecliptic (connecting the centers of the two circles at an angle of 23.439°). This shift can be "upwards" (max. distance at the summer solstice) or "downwards" (max. distance at the winter solstice) depending on the actual latitude.
The following image shows the tilted and shifted solar circle for the Winter Solstice at 45° North. It is only the part b out of the whole circle in which the sun in visible: when continueing its path on the blue line it is night (but see the section Twilight below).
Fig. 1: Solar Circle for the Summer Solstice at 45° North
The following table calculates the exposed part b in relation to the whole circle. The formulas mention 3 parameters, which signify:
- Axis: Obliquity of the ecliptic (as the rotation axis of the Earth is not perpendicular to its orbital plane, the equatorial plane is not parallel to the ecliptic plane, but makes an angle of 23.439°); this is a constant value and changes slowly only within thousands of years.
- Lat: Latitude of the observer (0° at the equator, 90° at the Northpole).
- Day: Day of year (1st year 0...364, from 365 add 0.25 for every completed Year within the Great Year, i.e. 365.25...729.25 etc.). Notice, that the day of year does not start with the astronomically quite arbitrary January 1st, but with the day of the winter solstice in the first year a four years cycle (Thanks to David X. Callaway to point this out early in the text to avoid confusion.)
Note: The expression "observer" in the remarks refers to a hypothetical observer located on the center of the planet's "disc".
Simplifications
The calculation of a and m can be simplified to:
and
Because cos/sin=cot=1/tan, a and m can be merged into:
Since tan(x)=cot(90-x)=1/tan(90-x), the division can thankfully be converted into a multiplication. Also, tan(-Lat) is identical with -tan(Lat):
The expression
/182.625 can be precalculated and saved as a constant j:
Final Formula
This reduces the calculation of m prior the correction of out-of-range values to 3 multiplications and 1 addition:
(Note, that the argument of the cos function is in radians, whereas the arguments of the tan functions are in degrees. Thanks to Kim Mackay for pointing this out.)
Adjust the limits of m to be between 0...2; then
completes the calculation.
Function Graphs
Notice, that depending on what your plotting software accepts (deg/rad), you might need to modify the b formula slightly. For example would you use ARCCOS(1-m)/(2*PI())*360/180 in Microsoft Excel, which simplifies to ARCCOS(1-m)/PI(). Thanks to reader justanote for this observation.
Above formulas for the Length of Day b produce the following graphs over a whole year, shown for the latitudes at 0°, 10° ... 90° North:
Fig. 2: Length of Day graphs for the Northern hemisphere. Note, that the x Axis starts out with the Winter Solstice and is not identical with the calendary start. (Thanks to Martin Bonda for reminding me to make this clear.)
Twilight
The sun does not appear or disappear just so, a shorter or longer twilight period begins before the start of the day, or ends after the end of the day, resp., i.e. the twilight affects the duration of the "dark" night, never the duration of the "bright" day.
For most purposes, it is sufficient to take the Civil Twilight plus the Nautical Twilight into consideration, but not the Astronomical Twilight (which latter for casual observers would be interpreted as fully dark anyway).
Civil Twilight is defined as the sun being 6° below the horizon, Nautical Twilight as 12°. Therefore, the duration of the twilight depends on how long the sun needs to cross these 12°, and this (mainly) depends from the angle the sun circle is tilted towards the planet's "disc". This angle is steep (orthogonal to the planet's disc) at the equator. The further away from the equator the observer is, the flatter the angle becomes, and there are Northern regions in which not the whole twilight cycle is completed. This is the case for all latitudes North of 90°-Axis-12°=54.561°.
To some extent the angle also depends from the day of year: It is at the equinoxes that the angle is steepest for any latitude, and on the Northern hemisphere the summer solstice is flattest (also the winter solstice is flatter than at the equinoxes, but not so flat as at the summer solstice). However, the differences along a year are short and extend over some minutes only.
Formulae
When the planet's so far flat disc is given some height h, twilight is defined as the part e of the solar arc.
Fig. 3: Planet disc with added thickness
| The twilight angle (sun below horizon), as per definition above |
|
| Thickness of the planet's disc |
|
| The angle v is identical with the Latitude. This is true along the whole radius of the solar circle, particularly also where the distance between the solar circle and the surface of the planet disc is h |
|
| Knowing the angle v, the radius fraction i (an extention of the radius fraction m) can be calculated |
 |
| The whole radius fraction m+i defines the point, at which the planet disc's lower surface is crossed by the solar circle. The value m is the same as calculated above. Note, however, that its uncorrected value must be used. |
 |
| Adjust range: 0...2 is the valid range (see comments in the formula table of the preceding section) |
| Angle between center of sun's disc and lower twilight point on the solar circle (not the planet's disc) |
 |
| Exposed fraction of the sun's circle (0=never...1=whole day). The arc describes the daytime plus both twilight zones (b+2e). |
 |
Practical Calculation
n can not be simplified any more.
with the constants



Final Formula
This is the calculation of the twilight arc (comprising both twilight durations and the daylength):
Note, that the m part (before adjustment) is the same as in the previous section, but range adjustment for twilight calculation may not happen before the addition of the i part.
Then
completes the calculation.
Sample Values
Some individual twilight durations e (dusk or dawn) are given in the following table.
Note, that at and near the Pole there are phases with no twilight, because the sun is present all the day, or circles too far below the horizon. The values are given as 0, because half the difference between the daylength b and the arc comprising the day length and the 2 twilights ((b+2e - b)/2) are presented. These values are identical at the pole (and near it), i.e. 0 around the winter solstice, and 1 around the summer solstice (0 and 24 hrs., resp.)
| t=12° |
WS |
|
Eq |
|
SS |
|
Eq |
|
WS |
| Latitude |
Day 0.00 |
Day 45.66 |
Day 91.31 |
Day 136.97 |
Day 182.63 |
Day 228.28 |
Day 273.94 |
Day 319.59 |
Day 365.25 |
| 90° |
0.000 |
0.000 |
12.000 |
0.000 |
0.000 |
0.000 |
12.000 |
0.000 |
0.000 |
| 80° |
0.000 |
4.158 |
6.000 |
0.000 |
0.000 |
0.000 |
6.000 |
4.158 |
0.000 |
| 70° |
3.685 |
2.903 |
2.562 |
2.343 |
0.000 |
2.343 |
2.562 |
2.903 |
3.685 |
| 60° |
1.977 |
1.723 |
1.677 |
2.608 |
2.755 |
2.608 |
1.677 |
1.723 |
1.977 |
| 50° |
1.359 |
1.293 |
1.287 |
1.499 |
1.788 |
1.499 |
1.287 |
1.293 |
1.359 |
| 45° |
1.204 |
1.166 |
1.166 |
1.295 |
1.436 |
1.295 |
1.166 |
1.166 |
1.204 |
| 40° |
1.092 |
1.070 |
1.074 |
1.157 |
1.237 |
1.157 |
1.074 |
1.070 |
1.092 |
| 30° |
0.948 |
0.941 |
0.947 |
0.985 |
1.015 |
0.985 |
0.947 |
0.941 |
0.948 |
| 20° |
0.867 |
0.866 |
0.872 |
0.888 |
0.900 |
0.888 |
0.872 |
0.866 |
0.867 |
| 10° |
0.826 |
0.827 |
0.831 |
0.837 |
0.841 |
0.837 |
0.831 |
0.827 |
0.826 |
| 0° |
0.818 |
0.818 |
0.818 |
0.818 |
0.818 |
0.818 |
0.818 |
0.818 |
0.818 |
The table's cells give the duration in hours.
The following table shows the twilight duration for the civil twilight (6° rather than 12°).
| t=6° |
WS |
|
Eq |
|
SS |
|
Eq |
|
WS |
| Latitude |
Day 0.00 |
Day 45.66 |
Day 91.31 |
Day 136.97 |
Day 182.63 |
Day 228.28 |
Day 273.94 |
Day 319.59 |
Day 365.25 |
| 90° |
0.000 |
0.000 |
12.000 |
0.000 |
0.000 |
0.000 |
12.000 |
0.000 |
0.000 |
| 80° |
0.000 |
0.000 |
2.483 |
0.000 |
0.000 |
0.000 |
2.483 |
0.000 |
0.000 |
| 70° |
1.859 |
1.611 |
1.193 |
2.343 |
0.000 |
2.343 |
1.193 |
1.611 |
1.859 |
| 60° |
1.063 |
0.884 |
0.809 |
1.033 |
1.687 |
1.033 |
0.809 |
0.884 |
1.063 |
| 50° |
0.695 |
0.650 |
0.627 |
0.696 |
0.783 |
0.696 |
0.627 |
0.650 |
0.695 |
| 45° |
0.609 |
0.583 |
0.570 |
0.613 |
0.661 |
0.613 |
0.570 |
0.583 |
0.609 |
| 40° |
0.549 |
0.533 |
0.526 |
0.553 |
0.582 |
0.553 |
0.526 |
0.533 |
0.549 |
| 30° |
0.472 |
0.467 |
0.465 |
0.477 |
0.488 |
0.477 |
0.465 |
0.467 |
0.472 |
| 20° |
0.430 |
0.428 |
0.428 |
0.433 |
0.438 |
0.433 |
0.428 |
0.428 |
0.430 |
| 10° |
0.408 |
0.408 |
0.408 |
0.410 |
0.411 |
0.410 |
0.408 |
0.408 |
0.408 |
| 0° |
0.402 |
0.402 |
0.402 |
0.402 |
0.402 |
0.402 |
0.402 |
0.402 |
0.402 |
The table's cells give the duration in hours.