solarex v0.1.2 Solarex.Moon View Source

Solarex.Moon is module for calculating moon phase for particular date.

This module implements naive approach by calculating the number of days since a known new moon. See Wikipedia page for more info.

Link to this section Summary

Functions

Returns remaining days to next new moon for the passed date using know new moon date and synodic month https://en.wikipedia.org/wiki/Lunar_phase#Calculating_phase

Returns moon phase for the current date.

Calculate moon phase for the passed Date.

Link to this section Functions

Link to this function

days_to_new_moon(date) View Source
days_to_new_moon(Date.t()) :: number()

Returns remaining days to next new moon for the passed date using know new moon date and synodic month https://en.wikipedia.org/wiki/Lunar_phase#Calculating_phase

iex> Solarex.Moon.days_to_new_moon(~D[2019-05-05])
0.8776445879999955

Returns moon phase for the current date.

Calculate moon phase for the passed Date.

Returns one of :new_moon, :waxing_crescent, :first_quarter, :waxing_gibbous, :full_moon, :waning_gibbous, :third_quarter, :waning_crescent, :new_moon atom.

iex> Solarex.Moon.phase(~D[2019-05-05])
:new_moon