Astro.Lunar (Astro v0.5.0) View Source
Calulates lunar phases.
Each of the phases of the Moon is defined by the angle between the Moon and Sun in the sky. When the Moon is in between the Earth and the Sun, so that there is nearly a zero degree separation, we see a New Moon.
Because the orbit of the Moon is tilted in relation to the Earth’s orbit around the Sun, a New Moon can still be as much as 5.2 degrees away from the Sun, thus why there isn't a solar eclipse every month.
A crescent moon is 45 degrees from the Sun, a quarter moon is 90 degrees from the Sun, a gibbous moon is 135 degrees from the Sun, and the Full Moon is 180 degrees away from the Sun.
Link to this section Summary
Functions
Returns the date time of a given lunar phase at or after a given date time or date.
Returns the date time of a given lunar phase at or before a given moment.
Returns the date time of the new moon at or after a given date or date time.
Returns the date time of the new moon before a given moment.
Returns the first quarter lunar phase expressed as a float number of degrees.
Returns the full moon lunar phase expressed as a float number of degrees.
Returns the last quarter lunar phase expressed as a float number of degrees.
Returns the lunar phase as a float number of degrees at a given moment.
Returns the new moon lunar phase expressed as a float number of degrees.
Link to this section Functions
Specs
date_time_lunar_phase_at_or_after(Astro.Time.moment(), Astro.phase()) :: Astro.Time.moment()
Returns the date time of a given lunar phase at or after a given date time or date.
Arguments
a
momentwhich is a float number of days since0000-01-01phaseis the required lunar phase expressed as a float number of degrees between0and3660
Returns
- a
t:Time.moment()which is a float number of days since0000-01-01
Example
iex> Astro.Lunar.date_time_lunar_phase_at_or_after(738368, Astro.Lunar.full_moon())
738389.5007195644
Specs
date_time_lunar_phase_at_or_before(Astro.Time.moment(), Astro.phase()) :: Astro.Time.moment()
Returns the date time of a given lunar phase at or before a given moment.
Arguments
a
t:Time.moment()which is a float number of days since0000-01-01phaseis the required lunar phase expressed as a float number of degrees between0.0and360.0
Returns
- a
t:Time.moment()which is a float number of days since0000-01-01
Example
iex> Astro.Lunar.date_time_lunar_phase_at_or_before(738368, Astro.Lunar.new_moon())
738346.0544609067
Specs
date_time_new_moon_at_or_after(Astro.Time.moment()) :: Astro.Time.moment()
Returns the date time of the new moon at or after a given date or date time.
Arguments
- a
t:Time.moment()which is a float number of days since0000-01-01
Returns
- a
t:Time.moment()which is a float number of days since0000-01-01
Example
iex> Astro.Lunar.date_time_new_moon_at_or_after 738390
738405.036174502
Specs
date_time_new_moon_before(Astro.Time.moment()) :: Astro.Time.moment()
Returns the date time of the new moon before a given moment.
Arguments
- a
t:Time.moment()which is a float number of days since0000-01-01
Returns
- a
t:Time.moment()which is a float number of days since0000-01-01
Example
iex> Astro.Lunar.date_time_new_moon_before 738390
738375.5774296349
Specs
first_quarter() :: Astro.phase()
Returns the first quarter lunar phase expressed as a float number of degrees.
Specs
full_moon() :: Astro.phase()
Returns the full moon lunar phase expressed as a float number of degrees.
Specs
last_quarter() :: Astro.phase()
Returns the last quarter lunar phase expressed as a float number of degrees.
Specs
lunar_phase_at(Astro.Time.moment()) :: Astro.Time.moment()
Returns the lunar phase as a float number of degrees at a given moment.
Arguments
- a
t:Time.moment()which is a float number of days since0000-01-01
Returns
- the lunar phase as a float number of degrees.
Example
iex> Astro.Lunar.lunar_phase_at 738389.5007195644
180.00001443052076
iex> Astro.Lunar.lunar_phase_at 738346.0544609067
359.9999929267571
Specs
new_moon() :: Astro.phase()
Returns the new moon lunar phase expressed as a float number of degrees.