Skip to content

Commit

Permalink
Fixing last Moon issues
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Foellmi <[email protected]>
  • Loading branch information
onekiloparsec committed Apr 24, 2024
1 parent 281796f commit 9524157
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/earth/moon/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function getPhaseAngle (jd: JulianDay): Degree {
const Delta: Kilometer = getRadiusVectorInKilometer(jd) // kilometer!!!
// Distance Earth-Sun
const R: Kilometer = getEarthRadiusVector(jd) * ONE_UA_IN_KILOMETERS
return Math.atan2(R * Math.sin(psi), Delta - (R * Math.cos(psi))) * RAD2DEG
return Math.atan2(R * Math.sin(psi), Delta - R * Math.cos(psi)) * RAD2DEG
}

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ export function getPositionAngleOfTheBrightLimb (jd: JulianDay): Degree {
*/
export function getIlluminatedFraction (jd: JulianDay): number {
const phaseAngle = getPhaseAngle(jd) * DEG2RAD
return 1 + Math.cos(phaseAngle) / 2
return (1 + Math.cos(phaseAngle)) / 2
}

/**
Expand Down

0 comments on commit 9524157

Please sign in to comment.