Fajr is light, not an angle.

takbir finds Fajr and Isha by simulating the light in the sky and the eye that sees it. Open source.

04:29

The white thread is distinct and spreads along the horizon. This is Fajr.

Mecca, 13 June 2026, clear sky. Drawn as the eye sees it.

وَكُلُوا۟ وَٱشْرَبُوا۟ حَتَّىٰ يَتَبَيَّنَ لَكُمُ ٱلْخَيْطُ ٱلْأَبْيَضُ مِنَ ٱلْخَيْطِ ٱلْأَسْوَدِ مِنَ ٱلْفَجْرِ

“…and eat and drink until the white thread of dawn becomes distinct to you from the black thread of night.”

Al-Baqarah 2:187

The Quran defines Fajr by what can be seen. What can be seen depends on light, air and the human eye, and all three can be computed.

Three prayers are geometry. Two are light.

Every prayer time follows the sun. For Dhuhr, Asr and Maghrib the sun is in the sky, and its position is the answer. For Fajr and Isha it is below the horizon, out of sight, and the answer is in the glow of the sky.

Horizon18° below
Fajr04:29
Sunrise05:38
Dhuhr12:20
Asr15:40
Maghrib19:03
Isha20:12
The sun over Mecca on 13 June 2026. Fajr and Isha are the engine's output for a clear sky; the other times are geometry.

When the sun is in view, geometry decides.

These times are solved problems. An ephemeris and a little trigonometry give them to the second, anywhere on Earth, on any date.

Dhuhr12:20
Begins once the sun passes its highest point of the day and starts to decline.
Asr15:40
Begins when a shadow equals its object's length plus the noon shadow. Twice the length in the Hanafi school.
Maghrib19:03
Begins when the upper edge of the sun sinks below the horizon.

When it is not, light decides.

Neither moment has a geometric definition. The sun is out of sight, and what reaches you is its light scattered through the air overhead, often several times.

Fajr04:29
Begins when the white thread of dawn becomes distinct from the night sky and spreads along the horizon.
Isha20:12
Begins when the glow in the west is gone: the red glow for the Shafi'i, Maliki and Hanbali schools, the white glow after it for the Hanafi school.

Haze, cloud, moonlight, latitude and street lights all change when that glow becomes visible. Observers have recorded true dawn with the sun anywhere from about 12 to 15 degrees below the horizon. A fixed angle such as 18° assumes it is always the same.

Same sun. Different skies.

The 18° rule gives one answer for every morning. The light does not. This is one morning in Mecca, computed by the engine under four skies.

  • Clear desert sky

    No city light. The thread stands out against a truly dark night.

    04:29 +17 min
  • City lights

    Street light brightens the night sky, so the dawn has to grow brighter before it stands out.

    04:40 +28 min
  • Thin cloud

    A veil of high cirrus dims the dawn glow on its way to you.

    04:38 +26 min
  • Dusty air

    Desert dust dims the long, low paths the dawn light travels.

    05:05 +53 min

City light raises the brightness of the night sky, so the dawn has to grow brighter before it stands out. Cloud and dust dim the dawn glow on its long, low path to you. An angle cannot know any of this. A simulation of the light can, which is why takbir takes tonight's forecast, aerosol, satellite cloud and measured city light as its inputs.

A fixed angle cannot follow the seasons.

In 2015 the OpenFajr project photographed the dawn over Birmingham, UK, on 300 mornings. A panel of 19 astronomers, timekeepers and mosque observers judged when Fajr began on 42 clear ones. takbir was calibrated in the desert, twenty degrees further south, and never tuned to these days.

05:45BST, sun 11.3° below the horizon
One of the 42 panel mornings, 23 September 2015: the OpenFajr all-sky camera, one frame a minute, unwrapped to the eastern horizon. The bright dot is Venus. At the 18° rule the sky is still night. The panel judged Fajr at 05:22; takbir, never shown these images, computes 05:21:49. Every frame is scaled the same way, so the first glow is as faint here as it was. Images: OpenFajr Research Project.
takbir
0.95°
typical error, all 42 days
Fixed 15°
1.59°
on the 34 days it exists
Fixed 18°
4.41°
on the 27 days it exists

Typical error is the root-mean-square difference from the panel, in degrees of sun depression. Around midsummer the sun never sinks 18° below Birmingham's horizon, so that rule has no answer on 15 of the 42 days. The summer shift that UK scholars apply by hand appears in takbir's results on its own.

How takbir sees the dawn.

YouEarth's shadowSunlit airEdge of the shadowSunlight, from below your horizonScattered again
At Fajr depth the air you look through is in Earth's shadow. The light that reaches you was scattered at least twice: first in sunlit air high up and far toward the sun, then again in the shadowed air in front of you. Not to scale.
  1. Measure tonight's sky

    Weather and aerosols at the prayer hour, satellite cloud cover and height, a neural network that rebuilds the 3D cloud field from the latest geostationary scan, measured city light and the real moon.

  2. Trace the light

    Backward Monte Carlo through a curved, refracting atmosphere 150 km deep: 56 shells, 41 wavelengths, full polarization. About 430 million photon paths for one day of times.

  3. Ask the eye

    A dark-adapted observer watches the horizon. Fajr is the moment the dawn's rise above the night sky becomes distinct across the whole band. A narrow glow that comes first is the false dawn, reported separately. Isha runs the same test in reverse.

  4. Every time comes with a ± band, carried through from the Monte Carlo noise and each measured input.

Checked against people who watched the dawn.

Every published dawn campaign that could be pinned to a place, a season and an angle. 16 campaigns in 7 countries, from a purpose-built camera in 1908 to sky meters in 2019. Nothing was retuned per site.

0.26°

Median difference from the observers over the 14 scored campaigns. About a minute and a half of clock time.

All-sky camera frame at 04:59: a dark sky with street lights at the rim

04:5918° rule. Still night.

All-sky camera frame at 05:22: a faint glow begins at the eastern rim

05:22Panel and takbir: Fajr. A first, faint glow.

All-sky camera frame at 05:45: the eastern sky is clearly bright

05:45The dawn is plain to see.

What the observers judge: the whole sky in one circle, one frame a minute. OpenFajr all-sky camera, Birmingham, 23 September 2015, one of the 42 panel mornings. East is at the lower right.

Fajr

  • Riyadh desert (KACST)Saudi Arabia, 2004Naked eyetakbir 14.50observed 14.6 ± 0.3−0.10
  • HailSaudi Arabia, 2014-15Naked eyetakbir 14.46observed 14.01 ± 0.32+0.45
  • AswanEgypt, 2016Calibrated cameratakbir 14.82observed 14.90 ± 0.17−0.08
  • AswanEgypt, 1908Purpose-built cameratakbir 14.82observed 14.25+0.57
  • North SinaiEgypt, 2010-12Naked eyetakbir 14.16observed 14.61−0.45
  • MatrouhEgypt, 2009-13Photoelectrictakbir 14.32observed 14.5−0.18
  • KottamiaEgypt, 2010Naked eyetakbir 14.75observed 14.66 ± 0.2+0.09
  • Bahariya oasisEgypt, 2007Photoelectrictakbir 14.63observed 14.6+0.03
  • FayumEgypt, 2018-19Eye and sky metertakbir 14.41observed 13.75 to 14.8in range
  • Wadi Al-NatrunEgypt, 2014-15Naked eyetakbir 14.00observed 12.48 to 15.14in range
  • Tubruq, desert horizonLibya, 2009-13Naked eyetakbir 14.68observed 14.66 to 14.700.00
  • Sana'a, 2200 mYemen, 2003Naked eyetakbir 15.04observed 13.2 to 18.8in range
  • DepokIndonesia, 2015Sky metertakbir 14.23observed 14.0 ± 0.6+0.23
  • Five sitesMalaysia, 2007-08Sky metertakbir 14.48observed 14.19 ± 0.52+0.29
  • Birmingham, 42 daysUK, 2015. Mean shown, RMS 0.95All-sky camera and paneltakbir 11.9 to 14.8observed 12.3 to 15.0+0.54

Open misses: sea and farmland horizons

  • Tubruq, sea horizonLibya, 2007-08Naked eyetakbir 14.68observed 13.43 to 13.48+1.22
  • Assiut, farmlandEgypt, 2012-14Naked eyetakbir 14.69observed 13.67+1.03

Isha

  • Isha, white twilightMecca vs Sabah, Malaysia, 2012Sky metertakbir 17.33observed 17.99 ± 0.16−0.66
  • Isha, red twilightMecca vs published sightingsNaked eyetakbir 14.96observed 12 to 15in range

Difference is takbir minus the published value. The shaded band is ±0.3°. Both misses look across a sea or farmland horizon instead of desert, a background the clear-sky reference does not yet model. Sources and the command behind every number are in the validation folder.

The light is checked separately.

The radiative transfer is compared with the reference codes of atmospheric physics: 144 of 144 cloud-slab points within 3% of DISORT and MYSTIC plus sampling error, true 3D clouds in band against SHDOM, and deep twilight under cloud against billion-photon MYSTIC runs. Against measured skies, the rate at which twilight darkens is within 1.2 to 5.5%.

Run it yourself.

twilight is the open-source engine behind takbir, written in Rust. It runs on any Vulkan, DX12 or Metal GPU, or on the CPU. Every validation table in the repository names the command that reproduces it.

View on GitHubMIT or Apache-2.0
Terminal
$ git clone https://github.com/Muno459/twilight$ cd twilight && cargo build --release$ ./target/release/twilight-cli pray --lat 21.4225 --lon 39.8262 --date 2026-06-13Fajr (khayt al-abyad): 04:29:51 ±0.4min  (SZA 104.71°, depression 14.71°)  └ white thread distinct from black + lateral spread (2:187, mustatir)  └ false dawn (al-fajr al-kadhib) visible from 04:28:30 - do not pray Fajr yetIsha (shafaq ahmar):   20:12:59 ±5.3min  (SZA 104.96°, depression 14.96°)  └ red band no longer distinct - Shafi'i/Maliki/Hanbali (primary)Isha (shafaq abyad):   20:25:13 ±0.5min  (SZA 107.33°, depression 17.33°)  └ white band no longer distinct - Hanafi