Liking cljdoc? Tell your friends :D

io.olympos.selene.moon

A library for computing moon phases

A library for computing moon phases
raw docstring

angle->closest-phaseclj/s

(angle->closest-phase rad)

Converts an angle, in radians, to the closest matching moon phase. The closest matching moon phase may not have happened yet: This means this is not a good fit for calendars to tell when the phase changes.

Converts an angle, in radians, to the closest matching moon phase.
The closest matching moon phase may not have happened yet: This
means this is not a good fit for calendars to tell when the phase changes.
raw docstring

angle->last-phase-changeclj/s

(angle->last-phase-change rad)

Converts an angle, in radians, to the last moon phase change.

Converts an angle, in radians, to the last moon phase change.
raw docstring

angle->upcoming-phase-changeclj/s

(angle->upcoming-phase-change rad)

Converts an angle, in radians, to the upcoming moon phase change.

Converts an angle, in radians, to the upcoming moon phase change.
raw docstring

closest-phaseclj/s

(closest-phase dt)

Returns the closest matching moon phase of the given datetime. The closest matching moon phase may not have happened yet: This means this is not a good fit for calendars -- use phase-change-on-date instead if this is important to you.

Returns the closest matching moon phase of the given datetime. The
closest matching moon phase may not have happened yet: This means
this is not a good fit for calendars -- use phase-change-on-date
instead if this is important to you.
raw docstring

last-phase-changeclj/s

(last-phase-change dt)

Returns the last moon phase change that happened before the given datetime.

Returns the last moon phase change that happened before the given
datetime.
raw docstring

next-phase-timeclj/s

(next-phase-time dt target-phase)

Returns the time of the first phase of type target-phase happening after dt, off by at most 30 seconds from the approximate value.

Due to calculation inaccuracies,

(let [x (next-phase-time dt phase) y (next-phase-time x phase)] (approx-equal? x y))

may or may not return true. If you want to make a sequence of the same phase, check for the next event 1 week after the current event.

Returns the time of the first phase of type target-phase happening
after dt, off by at most 30 seconds from the approximate value.

Due to calculation inaccuracies,

  (let [x (next-phase-time dt phase)
        y (next-phase-time x phase)]
    (approx-equal? x y))

may or may not return true. If you want to make a sequence of the
same phase, check for the next event 1 week after the current event.
raw docstring

phase->angleclj/s

Returns the angle of a given phase

Returns the angle of a given phase
raw docstring

phase-after-thisclj/s

A mapping from the current phase to the next one.

A mapping from the current phase to the next one.
raw docstring

phase-angleclj/s

(phase-angle dt)

Returns the phase angle of the given datetime, in radians.

Returns the phase angle of the given datetime, in radians.
raw docstring

phase-change-on-dateclj/s

(phase-change-on-date dt)

Returns the phase we changed into on this date, if any. More precicely, this returns the transition between the start of this day and the end of this day. Returns nil if there's no phase change today.

dt must be a datetime, as this needs a time zone to know exactly when the day starts and ends. Use (.atStartOfDay date zone-id) if you have a java.time.LocalDate instead.

Returns the phase we changed into on this date, if any. More
precicely, this returns the transition between the start of this day
and the end of this day. Returns nil if there's no phase change
today.

dt must be a datetime, as this needs a time zone to know exactly
when the day starts and ends. Use (.atStartOfDay date zone-id) if
you have a java.time.LocalDate instead.
raw docstring

phase-seqclj/s

(phase-seq {:keys [time]})

Returns a lazy seq of all the phases happening after dt, along with their timestamp.

Values will be on the form {:time dt, :phase phase}

Returns a lazy seq of all the phases happening after dt, along with
their timestamp.

Values will be on the form {:time dt, :phase phase}
raw docstring

phasesclj/s

A list of all the phases used by this library, in their order in the lunar month. ::new is considered the start of the month.

A list of all the phases used by this library, in their order in the
lunar month. ::new is considered the start of the month.
raw docstring

position-equatorial-phiclj/s

(position-equatorial-phi jd)

upcoming-phase-changeclj/s

(upcoming-phase-change dt)

Returns the first moon phase change that will happen after the given datetime.

Returns the first moon phase change that will happen after the given
datetime.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close