Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign Error in Julian Date Calculation #28

Open
Atom-Timing opened this issue Jan 31, 2025 · 0 comments
Open

Sign Error in Julian Date Calculation #28

Atom-Timing opened this issue Jan 31, 2025 · 0 comments

Comments

@Atom-Timing
Copy link

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant