The previous article — The Math Behind GeoLog’s Ephemeris — walked through the equations Jean Meeus uses to compute celestial positions. This article works through those equations with real numbers, step by step, for a specific location and date.
Location: Klyde Warren Park, Dallas, Texas Coordinates: \phi = 32.7897°\text{N}, \lambda_{obs} = -96.8017° (West is negative) Date: June 21, 2026 — Summer Solstice Timezone: CDT = UTC−5
Table of Contents
Step 1: The Julian Day
We want to compute the sun’s position at local noon — 12:00 CDT, which is 17:00 UTC. June is month 6, so no January/February adjustment is needed.
A = \lfloor 2026 / 100 \rfloor = 20 B = 2 – 20 + \lfloor 20/4 \rfloor = 2 – 20 + 5 = -13 JD = \lfloor 365.25 \times (2026 + 4716) \rfloor + \lfloor 30.6001 \times (6 + 1) \rfloor + 21 + \frac{17.0}{24} + (-13) – 1524.5 JD = 2{,}467{,}615 + 214 + 21 + 0.70833 – 13 – 1524.5 = \mathbf{2{,}461{,}213.20833}Julian centuries since J2000.0 (JD 2451545.0):
T = \frac{2{,}461{,}213.20833 – 2{,}451{,}545.0}{36525} = \mathbf{0.26470112}Why January and February are treated as months 13 and 14
Meeus borrowed this convention from older astronomical tables. The Julian Day formula uses the factor \lfloor 30.6001 \times (M + 1) \rfloor to count the days in each month. This factor works cleanly for months 3 through 14 (March through February of the following year) but breaks down for January and February if treated as months 1 and 2, because those months follow December of the same year rather than preceding March of the next year.
By rolling January and February back into the previous year as months 13 and 14, the formula treats the calendar year as running from March to February — a convention that goes back to Julius Caesar’s original calendar reform. The arithmetic then works consistently for every month.
Example — February 5, 2026 (a Nubble Light planning date):
Since M = 2 ≤ 2, we adjust: Y becomes 2025, M becomes 14.
This is the correct JD for February 5, 2026 at 12:00 UTC — confirming the adjustment works correctly.
What are all those magic numbers?
Great question — these are the “magic numbers” that appear throughout the Julian Day formula, and every one of them has a specific astronomical or mathematical meaning. Here’s the explanation to add as a new section or side-note right after the Julian Day calculation, before The Fundamental Constants:
What Are All Those Numbers?
The Julian Day formula contains several constants that look arbitrary but each encodes something precise about the calendar or the solar system.
4716 — The Julian Day count begins at noon on January 1, 4713 BC in the Julian calendar (astronomers chose this because it precedes all known historical astronomical records). Adding 4716 to the year shifts the epoch so that \lfloor 365.25 \times (Y + 4716) \rfloor counts the correct number of days from that origin to the start of the target year. It is purely an offset to make the arithmetic work from a fixed starting point.
365.25 — The mean length of a Julian year in days. The factor of 0.25 accounts for the leap year cycle: every four years an extra day is added, so the average year is 365.25 days. The floor function \lfloor 365.25 \times (Y + 4716) \rfloor counts whole days only, discarding the fractional accumulation until it tips over into a new day.
30.6001 — The mean number of days between the first of one month and the first of the next, averaged across the year. The value is deliberately slightly more than 30.6 to ensure that \lfloor 30.6001 \times (M + 1) \rfloor always rounds down correctly for every month from March (M=3) through February (M=14). Using exactly 30.6 would cause rounding errors for certain months.
The (M + 1) — The formula counts days from the first of the previous month, not the current one. Adding 1 shifts the month index so that the floor function lands on the correct accumulated day count. This is a consequence of the March-to-February year convention — each month’s day count is tabulated relative to the one before it.
17.0 / 24 — This converts the UTC hour to a decimal fraction of a day. A full day = 24 hours, so 17:00 UTC = 17/24 = 0.70833 days. Julian Days start at noon (12:00 UTC), so 17:00 UTC is 5 hours past the JD boundary, which is 5/24 of the way through the JD count. The formula handles this automatically — the 0.5 offset in the −1524.5 constant adjusts for the noon epoch.
−1524.5 — This is a composite offset that adjusts the raw count down to the correct Julian Day origin. The 0.5 comes from the fact that Julian Days begin at noon (12:00 UTC), not midnight. Without the −0.5, the formula would produce Julian Day numbers that start at midnight, which is inconsistent with the astronomical convention established in 1849 by John Herschel. The −1524 is an additional fixed offset derived from the epoch arithmetic.
2,451,545.0 — The Julian Day number for January 1, 2000 at 12:00 UTC — the J2000.0 epoch. This is the reference point for T. Subtracting it from any JD gives the number of days since that reference moment. Dividing by 36,525 converts to Julian centuries. This particular epoch was chosen by the International Astronomical Union in 1984 as the standard reference for modern astronomical calculations.
36,525 — The number of days in exactly 100 Julian years (365.25 × 100). Dividing by this converts days into Julian centuries T. The Julian century is used rather than a single year because the slowly varying orbital coefficients (like 36000.76983° per century for the sun’s mean longitude) are most conveniently expressed per century — the numbers stay in a manageable range.
The Fundamental Constants
Once we have T, three quantities define the geometry of the solar system before we calculate anything else. These are not arbitrary magic numbers — each has a precise physical meaning.
The Epoch: J2000.0
JD_{2000} = 2{,}451{,}545.0January 1, 2000 at 12:00 UTC. Every modern astronomical formula measures time relative to this reference point. It was chosen because it falls near the middle of a century and simplifies numerical precision. T = 0 at this moment; T = 1 one Julian century (36,525 days) later.
The Obliquity of the Ecliptic ε
\varepsilon = 23.439° – 0.0000004° \times TEarth’s axial tilt — the angle between Earth’s rotational axis and the perpendicular to its orbital plane. It is what causes seasons. At J2000.0 it is 23.439°, decreasing very slowly over thousands of years (about 0.013° per century). For practical purposes it is essentially constant within a human lifetime.
This single number is the bridge between ecliptic coordinates (where the sun and moon move, along the plane of Earth’s orbit) and equatorial coordinates (what observers use, based on Earth’s equatorial plane). Without ε there is no way to convert between the two systems.
For our example: \varepsilon = 23.439° – 0.0000004° \times 0.26470 = \mathbf{23.4390°}
The Horizon Threshold h₀
h_0 = -0.833°This is not a property of the sun or moon — it is a property of Earth’s atmosphere and the geometry of observation. It combines two physical effects:
- Atmospheric refraction (+0.567°): the atmosphere bends light so the sun appears above the geometric horizon when it is physically just below it
- Solar semidiameter (+0.267°): “sunrise” is defined as the moment the upper limb of the disk clears the horizon, not the center
The sum is 0.833°, applied as a negative threshold because we ask when the center of the disk crosses −0.833° altitude. This same value is used for both sun and moon rise and set calculations.
What Separates the Sun from the Moon
After these shared constants, the sun and moon diverge because of their fundamentally different orbital motions.
The sun moves along the ecliptic as Earth orbits it — slowly, about 1° per day, in a nearly circular path. Its position needs only a handful of correction terms. The dominant one is the equation of center, which corrects for Earth’s slightly elliptical orbit. The two coefficients encode Earth’s orbital eccentricity (currently about 0.0167):
\lambda_\odot = L_0 + 1.914602°\sin M + 0.019993°\sin 2MThe moon moves much faster — about 13° per day — and its orbit is tilted 5.1° relative to the ecliptic, precessing over an 18.6-year cycle. It requires four mean orbital elements instead of two, and its longitude correction needs six significant perturbation terms instead of two. The dominant correction alone is 6.289° — more than three times the sun’s largest correction — reflecting how much the moon’s irregular orbit departs from a simple ellipse.
This is why the moon’s position is harder to compute accurately, and why the CircumpolarCondition is more complex for the moon than for the sun.
Step 2: Ecliptic Longitude
Mean longitude and mean anomaly of the sun:
L_0 = (280.46646° + 36000.76983° \times 0.26470112) \bmod 360° = \mathbf{89.9105°} M = (357.52911° + 35999.05029° \times 0.26470112) \bmod 360° = \mathbf{166.5180°}This is the summer solstice — note that L_0 \approx 90°, which is exactly what we expect when the sun is at the June solstice point.
True ecliptic longitude, correcting for the elliptical orbit:
\lambda = 89.9105° + 1.914602° \sin(166.5180°) + 0.019993° \sin(333.0360°) \lambda = 89.9105° + 1.914602° \times 0.2316 + 0.019993° \times (-0.4540) = \mathbf{90.3478°}Step 3: Equatorial Coordinates
Right ascension and declination using \varepsilon = 23.4390°:
\alpha = \arctan!\left(\frac{\cos 23.4390° \times \sin 90.3478°}{\cos 90.3478°}\right) = \mathbf{90.3791°} \delta = \arcsin(\sin 23.4390° \times \sin 90.3478°) = \mathbf{+23.4385°}The declination of +23.44° confirms this is the summer solstice — the sun is at its maximum northward declination.
Step 4: Horizontal Coordinates at Local Noon
Greenwich Mean Sidereal Time and Local Sidereal Time at JD 2461213.20833:
GMST = (280.46061837° + 360.98564736629° \times (2{,}461{,}213.20833 – 2{,}451{,}545.0)) \bmod 360° = \mathbf{164.9047°} LST = (164.9047° + (-96.8017°) + 360°) \bmod 360° = \mathbf{68.1030°}Hour Angle — how far the sun has moved past the meridian:
HA = (68.1030° – 90.3791° + 360°) \bmod 360° = \mathbf{337.7239°}An hour angle of 337.7° is equivalent to −22.3°, meaning the sun is about 22° past local solar noon, which is expected since 12:00 CDT is not exactly solar noon.
Altitude:
\sin h = \sin 32.7897° \times \sin 23.4385° + \cos 32.7897° \times \cos 23.4385° \times \cos 337.7239° \sin h = 0.5408 \times 0.3977 + 0.8411 \times 0.9174 \times 0.9238 = 0.2151 + 0.7138 = 0.9289 h = \arcsin(0.9289) = \mathbf{68.30°}Azimuth:
\cos A = \frac{\sin 23.4385° – \sin 32.7897° \times 0.9289}{\cos 32.7897° \times \cos 68.30°} = \frac{0.3977 – 0.5025}{0.8411 \times 0.3714} = \frac{-0.1048}{0.3124} = -0.3355 A = \arccos(-0.3355) = 109.60°Since \sin(HA) = \sin(337.72°) < 0, no quadrant correction is needed.
\mathbf{A = 109.83°} \text{ (East-Southeast)}GeoLog displays: Altitude 68.30°, Azimuth 109.83°
Step 5: Sunrise and Sunset
The bracketing root-finder scans from local midnight (JD – 0.5 = 2{,}461{,}212.70833) in 26 one-hour windows, looking for where the sun’s altitude crosses h_0 = -0.833°. The crossing is refined by 15 binary search iterations:
\text{precision} = \frac{3600\text{ s}}{2^{15}} \approx 0.11\text{ s}Sunrise:
JD_{rise} = 2{,}461{,}212.97199 \implies \mathbf{06{:}19{:}40 \text{ CDT}}, \quad A_{rise} = \mathbf{61.15°} \text{ (NNE)}Sunset:
JD_{set} = 2{,}461{,}213.56845 \implies \mathbf{20{:}38{:}34 \text{ CDT}}, \quad A_{set} = \mathbf{298.85°} \text{ (WNW)}Day length: 20:38 − 06:19 = 14 hours 18 minutes — the longest day of the year for Dallas.
Step 6: Transit Azimuth and Arc Direction
JD_{transit} = \frac{2{,}461{,}212.97199 + 2{,}461{,}213.56845}{2} = \mathbf{2{,}461{,}213.27022}At this Julian Day the sun’s azimuth is 180.00° — exactly due South at transit in the Northern Hemisphere, as expected.
Arc direction check:
\text{span}_{cw} = (298.85° – 61.15° + 360°) \bmod 360° = \mathbf{237.71°} \text{dist}_{cw} = (180.00° – 61.15° + 360°) \bmod 360° = \mathbf{118.85°}Since 118.85° < 237.71°, draw clockwise — the sun travels from NNE at sunrise, clockwise through East, South, West, to WNW at sunset. The DomeArc bows deeply toward center since the transit altitude reaches 80.65°.
Moon: June 21, 2026
Now we apply the same framework to the moon. The moon requires four mean orbital elements and six perturbation terms, reflecting the complexity of its orbit.
Moon’s Mean Orbital Elements
At JD 2461213.20833 (local noon CDT):
L_1 = (218.3164477° + 481267.88123421° \times 0.26470112) \bmod 360° = \mathbf{170.4626°} M_1 = (134.9633964° + 477198.8675055° \times 0.26470112) \bmod 360° = \mathbf{90.0371°} F = (93.2720950° + 483202.0175233° \times 0.26470112) \bmod 360° = \mathbf{197.3863°}Where L_1 is the moon’s mean longitude, M_1 its mean anomaly, M the sun’s mean anomaly (166.5180° from Step 2), and F the moon’s argument of latitude — its angular distance from the ascending node of its orbit.
Longitude and Latitude Corrections
The dominant perturbation terms from Meeus:
\Delta\lambda = +6.289° \sin M_1 – 1.274° \sin(2(L_1-F)-M_1) + 0.658° \sin 2(L_1-F) – 0.214° \sin 2M_1 – 0.186° \sin M – 0.114° \sin 2F \Delta\lambda = +6.289° \sin 90.04° + \cdots = \mathbf{+6.4005°} \lambda_{moon} = 170.4626° + 6.4005° = \mathbf{176.8631°} \Delta\beta = 5.128° \sin F + 0.280° \sin(M_1+F) – 0.272° \sin(F-M_1) – 0.173° \sin(2(L_1-F)+F) \beta_{moon} = \mathbf{-2.1619°}Moon’s Equatorial Coordinates
Converting from ecliptic (\lambda_{moon}, \beta_{moon}) to equatorial (\alpha, \delta) via \varepsilon = 23.4390°:
\alpha_{moon} = \mathbf{176.2627°} \delta_{moon} = \mathbf{-0.7368°}The declination of −0.74° means the moon is nearly on the celestial equator — it will rise almost due East and set almost due West today.
Moon at Local Noon
Applying the same GMST, LST, and HA calculation:
HA_{moon} = (68.1030° – 176.2627° + 360°) \bmod 360° = \mathbf{251.84°} h_{moon} = \arcsin(\sin 32.79° \times \sin(-0.74°) + \cos 32.79° \times \cos(-0.74°) \times \cos 251.84°) = \mathbf{-15.60°}The moon is 15.6° below the horizon at local noon — not visible during the day on the solstice.
GeoLog displays: Altitude −15.60°, Azimuth 80.56°
Moonrise and Moonset
The same bracketing root-finder, now using moon positions:
Moonrise:
JD_{mrise} = 2{,}461{,}213.25939 \implies \mathbf{13{:}13{:}32 \text{ CDT}}, \quad A_{mrise} = \mathbf{90.71°} \text{ (due East)}Moonset:
JD_{mset} = 2{,}461{,}212.75183 \implies \mathbf{01{:}02{:}38 \text{ CDT}}, \quad A_{mset} = \mathbf{273.01°} \text{ (due West)}The Moon’s Timeline Problem — Illustrated
Notice that moonset (01:02 CDT) occurs before moonrise (13:13 CDT) on this calendar day. The moon set in the early hours of the morning and will not rise again until early afternoon. Computing the transit midpoint reveals why:
JD_{mtransit} = \frac{2{,}461{,}213.25939 + 2{,}461{,}212.75183}{2} = 2{,}461{,}213.00561At this Julian Day the moon’s altitude is −56.69° — deep below the horizon. The transit itself occurs underground, between yesterday’s moonset and today’s moonrise. A naive implementation connecting today’s moonset to today’s moonrise would draw the MoonPath arc on the wrong side of the compass, representing the time the moon was below the horizon rather than above it.
GeoLog’s extended time slider expands the window to capture a complete rise-to-set cycle across the day boundary, and labels the out-of-day event with a Tomorrow badge so the photographer always knows which day the moonset belongs to.
GeoLog’s MoonPath arc on June 21, 2026:
- Rises at 13:13 CDT at 90.71° (due East)
- Sets the following morning at 01:02 CDT at 273° (due West)
- Traces a path across the southern sky — nearly symmetric, as expected when \delta_{moon} \approx 0°
Summary
| Sun | Moon | |
|---|---|---|
| Altitude at local noon | 68.30° | −15.60° |
| Azimuth at local noon | 109.83° (ESE) | 80.56° (ENE) |
| Rise time (CDT) | 06:19:40 | 13:13:32 |
| Rise azimuth | 61.15° (NNE) | 90.71° (E) |
| Set time (CDT) | 20:38:34 | 01:02:38 (next day) |
| Set azimuth | 298.85° (WNW) | 273.01° (W) |
| Transit altitude | 80.65° | −56.69° (below horizon) |
| Arc direction | Clockwise | Set before rise — extended slider required |
Every number in this table is what GeoLog computes in real time as you browse your location library, move the time slider, or point the phone in a new direction. Jean Meeus’s equations — published in 1991 — run inside a Rust library on your iPhone, hundreds of times per second, so the compass rose always shows you exactly where the light is.
GeoLog is a free iOS app for photo location scouting. Read the companion article: The Math Behind GeoLog’s Ephemeris


Leave a Reply