Skip to content

Commit

Permalink
Parameter documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sbooth committed Oct 29, 2023
1 parent 92cfac2 commit a6d3c13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/JulianDayNumber/Date+JD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ extension Date {
}

/// Creates a date value initialized to the specified Julian date in UTC.
public init(julianDate: Double) {
self.init(timeIntervalSince1970: (julianDate - unixEpochJD_UTC) * 86400)
/// - parameter JD: A Julian date in UTC.
public init(julianDate JD: Double) {
self.init(timeIntervalSince1970: (JD - unixEpochJD_UTC) * 86400)
}

/// Returns the number of days between `self` and the J2000 epoch.
Expand All @@ -33,6 +34,7 @@ extension Date {
}

/// Creates a date value relative to the J2000 epoch by a given number of days.
/// - parameter daysSinceJ2000: A decimal number of days.
public init(daysSinceJ2000: Double) {
self.init(julianDate: J2000JD_UTC + daysSinceJ2000)
}
Expand Down

0 comments on commit a6d3c13

Please sign in to comment.