-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from mannylopez/adopt-moontool
Adopt MoonTool formula for calculating moon phase
- Loading branch information
Showing
7 changed files
with
409 additions
and
402 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Created by manny_lopez on 7/12/24. | ||
|
||
import Foundation | ||
|
||
// MARK: - TinyMoon + MoonDetail | ||
|
||
extension TinyMoon { | ||
|
||
struct MoonDetail { | ||
let julianDay: Double | ||
/// Number of days elapsed into the synodic cycle, represented as a fraction | ||
let daysElapsedInCycle: Double | ||
/// Age of the moon in days, minutes, hours | ||
let ageOfMoon: (days: Int, hours: Int, minutes: Int) | ||
/// Illuminated portion of the Moon, where 0.0 = new and 0.99 = full | ||
let illuminatedFraction: Double | ||
/// Distance of moon from the center of the Earth, in kilometers | ||
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 | ||
let phase: Double | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.