Astro.Lunar (Astro v0.9.2) 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 fractional illumination of the moon at a given time as a fraction between 0.0 and 1.0.
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
moment
which is a float number of days since0000-01-01
phase
is the required lunar phase expressed as a float number of degrees between0
and3660
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.5007195254
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-01
phase
is the required lunar phase expressed as a float number of degrees between0.0
and360.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.0524695957
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.0352292997
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.5757777032
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
illuminated_fraction_of_moon(Astro.Time.time()) :: float()
Returns the fractional illumination of the moon at a given time as a fraction between 0.0 and 1.0.
Specs
last_quarter() :: Astro.phase()
Returns the last quarter lunar phase expressed as a float number of degrees.
Specs
lunar_altitude(Astro.Time.moment(), Geo.PointZ.t()) :: Astro.angle()
Specs
lunar_distance(Astro.Time.moment()) :: Astro.meters()
Specs
lunar_latitude(Astro.Time.moment()) :: Astro.angle()
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.00001498208536
iex> Astro.Lunar.lunar_phase_at 738346.0544609067
0.021567106773019873
Specs
lunar_position(Astro.Time.moment()) :: {Astro.angle(), Astro.angle(), Astro.meters()}
Specs
new_moon() :: Astro.phase()
Returns the new moon lunar phase expressed as a float number of degrees.