You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code incorrectly adds the observer's longitude (east) instead of subtracting it when computing the approximate solar transit time ($Japprox). This mistake shifts predicted times by approximately 4 minutes per degree of longitude. For example, London (≈0.13°E) would see ~30-second errors, while New York (≈74°W) could have discrepancies of ~8 minutes.
This error systematically delays sunrise/sunset predictions for eastern longitudes and advances them for western longitudes.
The code incorrectly adds the observer's longitude (east) instead of subtracting it when computing the approximate solar transit time (
$Japprox
). This mistake shifts predicted times by approximately 4 minutes per degree of longitude. For example, London (≈0.13°E) would see ~30-second errors, while New York (≈74°W) could have discrepancies of ~8 minutes.This error systematically delays sunrise/sunset predictions for eastern longitudes and advances them for western longitudes.
// Incorrect line in calculateSun():
$Japprox = 2451545 + 0.0009 + ($this->lon / 360) + $n;
// Fixed line:
$Japprox = 2451545 + 0.0009 + (-$this->lon / 360) + $n;
The text was updated successfully, but these errors were encountered: