Skip to content

Commit

Permalink
Fix azimuth
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Sep 12, 2020
1 parent c0ad92a commit bea3bbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,14 @@ internal object Astro {

fun azimuth(hourAngle: Double, latitude: Double, declination: Double): Double {
return reduceAngleDegrees(
180 -
Math.toDegrees(
atan2(
sinDegrees(hourAngle),
cosDegrees(hourAngle) * sinDegrees(latitude) - tanDegrees(declination) * cosDegrees(
latitude
)
)
Math.toDegrees(
atan2(
sinDegrees(hourAngle),
cosDegrees(hourAngle) * sinDegrees(latitude) - tanDegrees(declination) * cosDegrees(
latitude
)
)
) - 180
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class AstroTest {

@Test
fun azimuth(){
assertEquals(111.9663, Astro.azimuth(64.352133, 38.92139, -6.719892), 0.0001)
assertEquals(248.0337, Astro.azimuth(64.352133, 38.92139, -6.719892), 0.0001)
}

@Test
Expand Down

0 comments on commit bea3bbf

Please sign in to comment.