Skip to content

Commit

Permalink
fix: calculation of apparent sidereal time at Greenwich
Browse files Browse the repository at this point in the history
Fixes #40
  • Loading branch information
klausbrunner committed Dec 1, 2023
1 parent 4375cfe commit e79ecf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/e175/klaus/solarpositioning/SPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ private static double calculateApparentSiderealTimeAtGreenwich(
limitDegreesTo360(
280.46061837
+ 360.98564736629 * (jd.julianDate() - 2451545)
+ 0.000387933 * pow(jd.julianCentury(), 2)
- pow(jd.julianCentury(), 2) / 38710000);
+ pow(jd.julianCentury(), 2) * (0.000387933 - jd.julianCentury() / 38710000));

return nu0degrees + deltaPsi * cos(toRadians(epsilonDegrees));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void testSpaExample() {
SolarPosition result =
SPA.calculateSolarPosition(time, 39.742476, -105.1786, 1830.14, 67, 820, 11);

assertEquals(194.340241, result.azimuth(), TOLERANCE / 10);
assertEquals(50.111622, result.zenithAngle(), TOLERANCE / 10);
assertEquals(194.340241, result.azimuth(), TOLERANCE / 100);
assertEquals(50.111622, result.zenithAngle(), TOLERANCE / 100);
}

@Test
Expand Down

0 comments on commit e79ecf1

Please sign in to comment.