Skip to content

[2.4.0] Add MoonDetail to public API

Compare
Choose a tag to compare
@mannylopez mannylopez released this 13 Jul 17:38
· 21 commits to main since this release
8705319

MoonDetail includes much more granular properties for the moon at a given time. The plan is to expose these in the public API soon, but for now, they can be accessed through the public API via MoonDetail.

public struct MoonDetail: Hashable {

    public let julianDay: Double
    /// Number of days elapsed into the synodic cycle, represented as a fraction
    public let daysElapsedInCycle: Double
    /// Age of the moon in days, minutes, hours
    public let ageOfMoon: (days: Int, hours: Int, minutes: Int)
    /// Illuminated portion of the Moon, where 0.0 = new and 0.99 = full
    public let illuminatedFraction: Double
    /// Distance of moon from the center of the Earth, in kilometers
    public let distanceFromCenterOfEarth: Double
    /// Phase of the Moon, represented as a fraction
    ///
    /// Varies between `0.0` to `0.99`.
    /// `0.0` new moon,
    /// `0.25` first quarter,
    /// `0.5` full moon,
    /// `0.75` last quarter
    public let phase: Double
}