Prayer times, part 2: where is the sun today?
In part 1 we saw that every prayer time is a sentence about the sun. The sun declines. A shadow reaches a length. The twilight fades. A white line spreads along the horizon.
To turn those sentences into a number, you need to know where the sun is. Not roughly, but exactly: on this date, in this city, at this minute. That is what this part is about. By the end you will have a small program that tells you two facts about the sun for any date, and you will use them to work out the moment the sun is highest over your head today, which you can check with a stick.
Part 1 covered what the Quran, the Sunnah and the early generations say about prayer times. This part builds the one piece of astronomy everything else depends on. Part 3 uses it to compute Dhuhr, sunrise and Maghrib. The full series is under the prayer time calculation tag.
From words to numbers
The scholars of the first centuries left exact definitions in words. Turning them into numbers for a given city on a given day was the work of a different kind of scholar.
In ninth century Baghdad, al-Khwarizmi compiled a zij, a book of tables giving the position of the sun, moon and planets for any date, with instructions for using them. Al-Battani, a generation later, measured the length of the year and the tilt of the earth's axis so precisely that his numbers were still being quoted in Europe seven hundred years on. By the thirteenth century the great mosques of Cairo and Damascus employed a muwaqqit, a timekeeper whose job was to apply these tables to the prayer times of his own city. The most famous of them, Ibn al-Shatir, was muwaqqit of the Umayyad Mosque in Damascus and built a sundial for it in 1371 that computed the prayer times directly from the shadow.
A zij was a big book because the astronomers had to tabulate everything by hand. We are going to write a very small zij, about thirty lines, that gives us the two numbers the muwaqqit needed for the sun.
The two numbers
Think about what a prayer time actually needs to know.
Dhuhr needs to know when the sun is at its highest over your city, which is not 12:00 on the clock. Fajr, Maghrib and Isha need to know when the sun is a certain distance below your horizon. Asr needs to know how high the sun climbs today, because that sets the length of the shortest shadow.
All of those depend on where you are, which we handle in part 3, and on two things that change with the date and are the same for everyone on earth:
- How far north or south of the equator the sun stands today. Astronomers call it the sun's declination.
- How far ahead of or behind the clock the sun is running today. Astronomers call it the equation of time.
Get these two from the date, add your latitude and longitude, and everything else is geometry.
Declination: the sun's latitude
The earth's axis is tilted by about 23.44° compared to its path around the sun. As the earth goes around, that tilt makes the sun appear to drift north and south over the year. On 21 June the sun stands directly over the Tropic of Cancer, 23.44° north. On 21 December it stands over the Tropic of Capricorn, 23.44° south. On the two equinoxes in March and September it is directly over the equator.
The declination is the latitude the sun is "over" today. It runs from +23.44° to -23.44° and back every year.
Why it matters to you: Jakarta is at about 6.2° south. Twice a year, in early March and again in early October, the declination is exactly -6.2°, and at noon on those days the sun is straight overhead and a vertical stick casts no shadow at all. On every other day the noon shadow has some length, and that length is set by the gap between your latitude and today's declination. That is the stick from part 1, and it is how Asr will be computed in part 5.
Equation of time: the sun runs fast and slow
Here is something that surprises most people. If you set a sundial to show exactly 12:00 at the moment the sun is highest on one day, it will be wrong on most other days of the year, by up to about 16 minutes.
The sun is not a perfect clock. The earth's orbit is slightly oval, so it moves faster in January and slower in July. And because the axis is tilted, the sun's eastward drift against the stars is not even across the year. Together these make the real sun run ahead of a perfect clock for part of the year and behind it for the rest. The difference is the equation of time. In early November the sun is about 16 minutes early. In mid February it is about 14 minutes late. Four times a year it is on time.
Every prayer time inherits this. If your app ignored the equation of time, Dhuhr would be off by a quarter of an hour in some months.
Counting days
Astronomy formulas do not want a month and a day. They want a single number: how many days have passed since some fixed starting point. The starting point almost everyone uses now is noon UTC on 1 January 2000, written J2000.0.
Astronomers get to that count through the Julian day, a continuous count of days running since 4713 BC. The Julian day of J2000.0 is 2451545.0. So the number we want is:
d = julian_day(date) - 2451545.0
Converting a calendar date to a Julian day takes a handful of integer tricks to account for the uneven months and leap years. The function below is the standard one from Jean Meeus's Astronomical Algorithms. You do not need to understand it. You need to know that it turns 17 October 2026 into 2461330.5, and that it works for every date after October 1582.
The recipe
With d in hand, this is the whole calculation. It comes from the Astronomical Almanac, the yearly reference published by the US and UK naval observatories, and it is accurate to about one sixtieth of a degree between 1950 and 2050. That is far more precision than a prayer timetable rounded to the minute can use. It is also, line for line, the formula inside libmuslim, the library that computes Muslimtify's times. What you write here is what the app runs.
All angles are in degrees. The mod 360 steps just keep the angles in the 0 to 360 range.
g = 357.529 + 0.98560028 * d mean anomaly: how far around its orbit the earth is
q = 280.459 + 0.98564736 * d mean longitude: where the sun would be if the orbit were a circle
L = q + 1.915 * sin(g) + 0.020 * sin(2g) true longitude: the correction for the oval orbit
e = 23.439 - 0.00000036 * d tilt of the earth's axis, shrinking very slowly
declination = asin( sin(e) * sin(L) )
right ascension = atan2( cos(e) * sin(L), cos(L) ) / 15 in hours
equation of time = q / 15 - right ascension in hours
Read the two lines with g and q first. Both are just "a starting angle plus a fixed amount per day". The 0.9856 is 360° divided by 365.25 days, the sun's average progress per day. The L line is the oval orbit correction, and it is where the "fast and slow" comes from. The e line is the tilt.
The last three lines convert that position into the two numbers we want. The declination is the sun's latitude. The right ascension is the sun's position measured eastward in hours, the way a star chart does it. The equation of time is the gap between where the sun would be on a perfect clock, q / 15, and where it really is.
Where the numbers come from
None of the constants are magic. Each one is a measurement of the earth's orbit, and there are only four kinds.
| Constant | What it is | How to check it |
|---|---|---|
357.529 | Mean anomaly at J2000.0: degrees travelled since the last perihelion, the earth's closest approach to the sun | 2.471° short of a full lap, at 0.9856°/day, is 2.5 days. Perihelion in 2000 fell on 4 January. |
280.459 | Mean longitude at J2000.0: the sun's position along its yearly path, measured from the March equinox point | 270° is the December solstice. 10.46° past it is 10.6 days, which lands on 1 January. |
0.98564736 | Degrees per day of mean longitude | 360 / 365.2422, the tropical year from equinox to equinox |
0.98560028 | Degrees per day of mean anomaly | 360 / 365.2596, the anomalistic year from perihelion to perihelion |
1.915, 0.020 | Correction for the oval orbit, in degrees | From the orbit's eccentricity e = 0.01671: 2e and (5/4)e² in radians, converted to degrees |
23.439 | Tilt of the earth's axis at J2000.0 | 23° 26′ 21.4″, measured |
0.00000036 | Decrease of the tilt per day | 46.8 arcseconds per century, from the pull of the other planets |
2451545.0 | Julian day of J2000.0 | Noon UTC on 1 January 2000 |
15 | Degrees per hour | The earth turns 360° in 24 hours |
The two rates differ in the fifth decimal because the perihelion point itself creeps forward, about one degree every 58 years, so a lap from perihelion to perihelion takes 25 minutes longer than a lap from equinox to equinox.
The 1.915 deserves one more sentence, because it is the only piece of real physics in the block. A planet on an oval orbit moves fastest when it is closest to the sun. Kepler worked out the correction for that, and for a nearly circular orbit it expands as 2e sin(g) + (5/4)e² sin(2g) with e the eccentricity. Put in e = 0.01671, convert from radians to degrees, and you get 1.915 sin(g) + 0.020 sin(2g). The next term would be about 0.0003°, which is why the Almanac stops at two.
The full solar model behind the Astronomical Almanac has hundreds of terms: the pull of the moon, the pull of Jupiter, and so on. These four lines are what remains after throwing all of that away and keeping only what is needed to stay within a minute of arc for a century. For a timetable rounded to the minute, that is everything.
The code
Here is the recipe in code, plus a solar_noon function that uses the equation of time to find when the sun is highest by your local clock. Pick your language. The tab you choose is remembered across the whole series.
- Python
- TypeScript
- Go
- Rust
- Kotlin
- Dart
- C
import math
def julian_day(year, month, day):
if month <= 2:
year -= 1
month += 12
a = year // 100
b = 2 - a + a // 4
return math.floor(365.25 * (year + 4716)) + math.floor(30.6001 * (month + 1)) + day + b - 1524.5
def sun_position(year, month, day):
d = julian_day(year, month, day) - 2451545.0 # days since J2000.0
g = math.radians((357.529 + 0.98560028 * d) % 360) # mean anomaly
q = (280.459 + 0.98564736 * d) % 360 # mean longitude, degrees
L = math.radians((q + 1.915 * math.sin(g) + 0.020 * math.sin(2 * g)) % 360) # ecliptic longitude
e = math.radians(23.439 - 0.00000036 * d) # tilt of the earth's axis
declination = math.degrees(math.asin(math.sin(e) * math.sin(L)))
right_ascension = math.degrees(math.atan2(math.cos(e) * math.sin(L), math.cos(L))) / 15 # hours
equation_of_time = (q / 15 - right_ascension + 12) % 24 - 12 # hours, kept near zero
return declination, equation_of_time * 60 # degrees, minutes
def solar_noon(year, month, day, longitude, timezone):
_, eqt = sun_position(year, month, day)
return 12 + timezone - longitude / 15 - eqt / 60 # local clock hours
if __name__ == "__main__":
dec, eqt = sun_position(2026, 10, 17)
print(f"declination {dec:.2f} deg, equation of time {eqt:.1f} min")
noon = solar_noon(2026, 10, 17, 106.8456, 7) # Jakarta, WIB
h = int(noon); m = (noon - h) * 60
print(f"solar noon in Jakarta {h:02d}:{m:04.1f}")
const rad = (deg: number) => (deg * Math.PI) / 180;
const deg = (rad: number) => (rad * 180) / Math.PI;
const mod = (a: number, n: number) => ((a % n) + n) % n;
function julianDay(year: number, month: number, day: number): number {
if (month <= 2) {
year -= 1;
month += 12;
}
const a = Math.floor(year / 100);
const b = 2 - a + Math.floor(a / 4);
return Math.floor(365.25 * (year + 4716)) + Math.floor(30.6001 * (month + 1)) + day + b - 1524.5;
}
function sunPosition(year: number, month: number, day: number) {
const d = julianDay(year, month, day) - 2451545.0; // days since J2000.0
const g = rad(mod(357.529 + 0.98560028 * d, 360)); // mean anomaly
const q = mod(280.459 + 0.98564736 * d, 360); // mean longitude, degrees
const L = rad(mod(q + 1.915 * Math.sin(g) + 0.02 * Math.sin(2 * g), 360)); // ecliptic longitude
const e = rad(23.439 - 0.00000036 * d); // tilt of the earth's axis
const declination = deg(Math.asin(Math.sin(e) * Math.sin(L)));
const rightAscension = deg(Math.atan2(Math.cos(e) * Math.sin(L), Math.cos(L))) / 15; // hours
const equationOfTime = mod(q / 15 - rightAscension + 12, 24) - 12; // hours, kept near zero
return { declination, equationOfTime: equationOfTime * 60 }; // degrees, minutes
}
function solarNoon(year: number, month: number, day: number, longitude: number, timezone: number): number {
const { equationOfTime } = sunPosition(year, month, day);
return 12 + timezone - longitude / 15 - equationOfTime / 60; // local clock hours
}
const { declination, equationOfTime } = sunPosition(2026, 10, 17);
console.log(`declination ${declination.toFixed(2)} deg, equation of time ${equationOfTime.toFixed(1)} min`);
const noon = solarNoon(2026, 10, 17, 106.8456, 7); // Jakarta, WIB
const h = Math.floor(noon);
console.log(`solar noon in Jakarta ${String(h).padStart(2, "0")}:${((noon - h) * 60).toFixed(1)}`);
package main
import (
"fmt"
"math"
)
func rad(deg float64) float64 { return deg * math.Pi / 180 }
func deg(rad float64) float64 { return rad * 180 / math.Pi }
func mod(a, n float64) float64 { return math.Mod(math.Mod(a, n)+n, n) }
func julianDay(year, month, day int) float64 {
if month <= 2 {
year--
month += 12
}
a := year / 100
b := 2 - a + a/4
return math.Floor(365.25*float64(year+4716)) + math.Floor(30.6001*float64(month+1)) + float64(day+b) - 1524.5
}
// sunPosition returns the declination in degrees and the equation of time in minutes.
func sunPosition(year, month, day int) (float64, float64) {
d := julianDay(year, month, day) - 2451545.0 // days since J2000.0
g := rad(mod(357.529+0.98560028*d, 360)) // mean anomaly
q := mod(280.459+0.98564736*d, 360) // mean longitude, degrees
L := rad(mod(q+1.915*math.Sin(g)+0.020*math.Sin(2*g), 360)) // ecliptic longitude
e := rad(23.439 - 0.00000036*d) // tilt of the earth's axis
declination := deg(math.Asin(math.Sin(e) * math.Sin(L)))
rightAscension := deg(math.Atan2(math.Cos(e)*math.Sin(L), math.Cos(L))) / 15 // hours
equationOfTime := mod(q/15-rightAscension+12, 24) - 12 // hours, kept near zero
return declination, equationOfTime * 60
}
func solarNoon(year, month, day int, longitude, timezone float64) float64 {
_, eqt := sunPosition(year, month, day)
return 12 + timezone - longitude/15 - eqt/60 // local clock hours
}
func main() {
dec, eqt := sunPosition(2026, 10, 17)
fmt.Printf("declination %.2f deg, equation of time %.1f min\n", dec, eqt)
noon := solarNoon(2026, 10, 17, 106.8456, 7) // Jakarta, WIB
h := math.Floor(noon)
fmt.Printf("solar noon in Jakarta %02d:%04.1f\n", int(h), (noon-h)*60)
}
fn julian_day(mut year: i32, mut month: i32, day: i32) -> f64 {
if month <= 2 {
year -= 1;
month += 12;
}
let a = year / 100;
let b = 2 - a + a / 4;
(365.25 * f64::from(year + 4716)).floor() + (30.6001 * f64::from(month + 1)).floor()
+ f64::from(day + b) - 1524.5
}
/// Returns (declination in degrees, equation of time in minutes).
fn sun_position(year: i32, month: i32, day: i32) -> (f64, f64) {
let d = julian_day(year, month, day) - 2451545.0; // days since J2000.0
let g = (357.529 + 0.98560028 * d).rem_euclid(360.0).to_radians(); // mean anomaly
let q = (280.459 + 0.98564736 * d).rem_euclid(360.0); // mean longitude, degrees
let l = (q + 1.915 * g.sin() + 0.020 * (2.0 * g).sin()).rem_euclid(360.0).to_radians(); // ecliptic longitude
let e = (23.439 - 0.00000036 * d).to_radians(); // tilt of the earth's axis
let declination = (e.sin() * l.sin()).asin().to_degrees();
let right_ascension = (e.cos() * l.sin()).atan2(l.cos()).to_degrees() / 15.0; // hours
let equation_of_time = (q / 15.0 - right_ascension + 12.0).rem_euclid(24.0) - 12.0; // hours, kept near zero
(declination, equation_of_time * 60.0)
}
fn solar_noon(year: i32, month: i32, day: i32, longitude: f64, timezone: f64) -> f64 {
let (_, eqt) = sun_position(year, month, day);
12.0 + timezone - longitude / 15.0 - eqt / 60.0 // local clock hours
}
fn main() {
let (dec, eqt) = sun_position(2026, 10, 17);
println!("declination {dec:.2} deg, equation of time {eqt:.1} min");
let noon = solar_noon(2026, 10, 17, 106.8456, 7.0); // Jakarta, WIB
let h = noon.floor();
println!("solar noon in Jakarta {:02}:{:04.1}", h as i32, (noon - h) * 60.0);
}
import kotlin.math.*
fun rad(deg: Double) = deg * PI / 180
fun deg(rad: Double) = rad * 180 / PI
fun mod(a: Double, n: Double) = ((a % n) + n) % n
fun julianDay(year: Int, month: Int, day: Int): Double {
var y = year
var m = month
if (m <= 2) {
y -= 1
m += 12
}
val a = y / 100
val b = 2 - a + a / 4
return floor(365.25 * (y + 4716)) + floor(30.6001 * (m + 1)) + day + b - 1524.5
}
data class SunPosition(val declination: Double, val equationOfTime: Double) // degrees, minutes
fun sunPosition(year: Int, month: Int, day: Int): SunPosition {
val d = julianDay(year, month, day) - 2451545.0 // days since J2000.0
val g = rad(mod(357.529 + 0.98560028 * d, 360.0)) // mean anomaly
val q = mod(280.459 + 0.98564736 * d, 360.0) // mean longitude, degrees
val l = rad(mod(q + 1.915 * sin(g) + 0.020 * sin(2 * g), 360.0)) // ecliptic longitude
val e = rad(23.439 - 0.00000036 * d) // tilt of the earth's axis
val declination = deg(asin(sin(e) * sin(l)))
val rightAscension = deg(atan2(cos(e) * sin(l), cos(l))) / 15 // hours
val equationOfTime = mod(q / 15 - rightAscension + 12, 24.0) - 12 // hours, kept near zero
return SunPosition(declination, equationOfTime * 60)
}
fun solarNoon(year: Int, month: Int, day: Int, longitude: Double, timezone: Double): Double {
val sun = sunPosition(year, month, day)
return 12 + timezone - longitude / 15 - sun.equationOfTime / 60 // local clock hours
}
fun main() {
val sun = sunPosition(2026, 10, 17)
println("declination %.2f deg, equation of time %.1f min".format(sun.declination, sun.equationOfTime))
val noon = solarNoon(2026, 10, 17, 106.8456, 7.0) // Jakarta, WIB
val h = floor(noon)
println("solar noon in Jakarta %02d:%04.1f".format(h.toInt(), (noon - h) * 60))
}
import 'dart:math';
double rad(double deg) => deg * pi / 180;
double deg(double rad) => rad * 180 / pi;
double mod(double a, double n) => ((a % n) + n) % n;
double julianDay(int year, int month, int day) {
if (month <= 2) {
year -= 1;
month += 12;
}
final a = year ~/ 100;
final b = 2 - a + a ~/ 4;
return (365.25 * (year + 4716)).floorToDouble() + (30.6001 * (month + 1)).floorToDouble() + day + b - 1524.5;
}
/// Declination in degrees and equation of time in minutes.
({double declination, double equationOfTime}) sunPosition(int year, int month, int day) {
final d = julianDay(year, month, day) - 2451545.0; // days since J2000.0
final g = rad(mod(357.529 + 0.98560028 * d, 360)); // mean anomaly
final q = mod(280.459 + 0.98564736 * d, 360); // mean longitude, degrees
final l = rad(mod(q + 1.915 * sin(g) + 0.020 * sin(2 * g), 360)); // ecliptic longitude
final e = rad(23.439 - 0.00000036 * d); // tilt of the earth's axis
final declination = deg(asin(sin(e) * sin(l)));
final rightAscension = deg(atan2(cos(e) * sin(l), cos(l))) / 15; // hours
final equationOfTime = mod(q / 15 - rightAscension + 12, 24) - 12; // hours, kept near zero
return (declination: declination, equationOfTime: equationOfTime * 60);
}
double solarNoon(int year, int month, int day, double longitude, double timezone) {
final sun = sunPosition(year, month, day);
return 12 + timezone - longitude / 15 - sun.equationOfTime / 60; // local clock hours
}
void main() {
final sun = sunPosition(2026, 10, 17);
print('declination ${sun.declination.toStringAsFixed(2)} deg, '
'equation of time ${sun.equationOfTime.toStringAsFixed(1)} min');
final noon = solarNoon(2026, 10, 17, 106.8456, 7); // Jakarta, WIB
final h = noon.floor();
print('solar noon in Jakarta ${h.toString().padLeft(2, '0')}:${((noon - h) * 60).toStringAsFixed(1)}');
}
#include <math.h>
#include <stdio.h>
#define PI 3.14159265358979323846
static double rad(double deg) { return deg * PI / 180.0; }
static double deg(double rad) { return rad * 180.0 / PI; }
static double mod(double a, double n) { return fmod(fmod(a, n) + n, n); }
static double julian_day(int year, int month, int day) {
if (month <= 2) {
year -= 1;
month += 12;
}
int a = year / 100;
int b = 2 - a + a / 4;
return floor(365.25 * (year + 4716)) + floor(30.6001 * (month + 1)) + day + b - 1524.5;
}
typedef struct {
double declination; /* degrees */
double equation_of_time; /* minutes */
} sun_position_t;
static sun_position_t sun_position(int year, int month, int day) {
double d = julian_day(year, month, day) - 2451545.0; /* days since J2000.0 */
double g = rad(mod(357.529 + 0.98560028 * d, 360)); /* mean anomaly */
double q = mod(280.459 + 0.98564736 * d, 360); /* mean longitude, degrees */
double L = rad(mod(q + 1.915 * sin(g) + 0.020 * sin(2 * g), 360)); /* ecliptic longitude */
double e = rad(23.439 - 0.00000036 * d); /* tilt of the earth's axis */
double declination = deg(asin(sin(e) * sin(L)));
double right_ascension = deg(atan2(cos(e) * sin(L), cos(L))) / 15; /* hours */
double equation_of_time = mod(q / 15 - right_ascension + 12, 24) - 12; /* hours, kept near zero */
return (sun_position_t){declination, equation_of_time * 60};
}
static double solar_noon(int year, int month, int day, double longitude, double timezone) {
sun_position_t sun = sun_position(year, month, day);
return 12 + timezone - longitude / 15 - sun.equation_of_time / 60; /* local clock hours */
}
int main(void) {
sun_position_t sun = sun_position(2026, 10, 17);
printf("declination %.2f deg, equation of time %.1f min\n", sun.declination, sun.equation_of_time);
double noon = solar_noon(2026, 10, 17, 106.8456, 7); /* Jakarta, WIB */
double h = floor(noon);
printf("solar noon in Jakarta %02d:%04.1f\n", (int)h, (noon - h) * 60);
return 0;
}
Build with gcc -std=c23 sun.c -lm -o sun.
One line deserves a comment: (q / 15 - right_ascension + 12) % 24 - 12. The raw difference can come out as, say, 23.76 hours when it means "0.24 hours early", because right ascension wraps around at 24. Adding 12, taking the remainder, and subtracting 12 again folds it back into the range from -12 to +12, which keeps the result near zero where it belongs.
Solar noon
The solar_noon function is the first prayer-shaped number in the series, so it is worth reading slowly.
noon = 12 + timezone - longitude / 15 - equation_of_time / 60
Start at 12:00. The earth turns 15° every hour, so a city 106.8456° east of Greenwich sees the sun at its peak 7 hours and 7.4 minutes before Greenwich does, hence - longitude / 15. But Jakarta's clocks are set to UTC+7, a round 7 hours, so we add the timezone back. That leaves the sun peaking at 11:52.6 by the Jakarta clock if the sun were a perfect clock. It is not. On 17 October it is running 14.6 minutes early, so we subtract that too.
Check your work
Run the program. For 17 October 2026 you should see:
declination -9.17 deg, equation of time 14.6 min
solar noon in Jakarta 11:38.1
A declination of -9.17° means the sun is standing over a point 9.17° south of the equator today, a little south of Jakarta, heading toward its southern limit in December. An equation of time of +14.6 minutes means the sun is running almost a quarter of an hour ahead of the clock.
Now check it against something you did not write. The NOAA solar calculator at gml.noaa.gov/grad/solcalc uses a more detailed version of the same astronomy. Enter Jakarta's coordinates and the date, and compare its "Equation of Time", "Solar Declination" and "Solar Noon". They should match ours to within a tenth of a minute and a hundredth of a degree.
Then check it against the sky. At 11:38 on 17 October, a vertical stick in Jakarta casts its shortest shadow of the day, pointing almost due south. If you want to feel what the muwaqqit felt, go outside and watch it.
Finally, open the Kemenag timetable for Jakarta and look at Dhuhr for the same date. It says 11:41, not 11:38. That gap is not an error. Kemenag adds two minutes of ihtiyat to every prayer and then rounds up to the next whole minute, so 11:38.1 becomes 11:40.1 and then 11:41. The precaution is the practical form of the hadith of Uqbah in part 1, which forbids praying while the sun still stands at its peak. Part 3 is where we add it.
A note on precision
The code evaluates the sun's position at the start of the day in UTC and uses that for the whole day. The declination changes by at most 0.4° a day, which is harmless for solar noon but can shift a twilight time by about a minute at high latitudes. The production algorithm in libmuslim recomputes the sun's position at the moment of each prayer. We will do the same from part 3 on, once we have a first estimate to refine.
What to carry into part 3
From a date alone, two numbers: where the sun stands north or south, and how far the sun is ahead of or behind the clock. From the second one, plus your longitude, the moment the sun is highest over your city.
Part 3 brings in your latitude. With it, the declination tells us how high the sun gets at noon and, more importantly for prayer, at what time it crosses the horizon on the way up and on the way down. That gives us sunrise, which ends Fajr, and sunset, which is Maghrib. It also gives us the tool that part 4 will point below the horizon to find the twilight angles.
