earthRotationAngle function

double earthRotationAngle(
  1. double jdUt
)

Earth rotation angle θ (radians, 0 ≤ θ < 2π) for jdUt – a Julian day in UT1, IERS Conventions (2010), chapter 5 (table 5.2e): θ = 2π·(0.7790572732640 + 1.00273781191135448·Tu), Tu = JD(UT1) − 2451545.0.

Implementation

double earthRotationAngle(double jdUt) {
  final tu = jdUt - j2000;
  // Część całkowitą obrotów (1·Tu) odrzucamy przed mnożeniem przez 2π,
  // żeby nie tracić cyfr przy dużym Tu.
  final turns = tu % 1 + 0.7790572732640 + 0.00273781191135448 * tu;
  return turns % 1 * 2 * math.pi;
}