Astro.Lunar (Astro v0.8.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 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

Link to this function

date_time_lunar_phase_at_or_after(t, phase)

View Source (since 0.5.0)

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 since 0000-01-01

  • phase is the required lunar phase expressed as a float number of degrees between 0 and 3660

Returns

  • a t:Time.moment() which is a float number of days since 0000-01-01

Example

iex> Astro.Lunar.date_time_lunar_phase_at_or_after(738368, Astro.Lunar.full_moon())
738389.5007195254
Link to this function

date_time_lunar_phase_at_or_before(t, phase)

View Source (since 0.5.0)

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 since 0000-01-01

  • phase is the required lunar phase expressed as a float number of degrees between 0.0 and 360.0

Returns

  • a t:Time.moment() which is a float number of days since 0000-01-01

Example

iex> Astro.Lunar.date_time_lunar_phase_at_or_before(738368, Astro.Lunar.new_moon())
738346.0524695957
Link to this function

date_time_new_moon_at_or_after(t)

View Source (since 0.5.0)

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 since 0000-01-01

Returns

  • a t:Time.moment() which is a float number of days since 0000-01-01

Example

iex> Astro.Lunar.date_time_new_moon_at_or_after 738390
738405.0352292997
Link to this function

date_time_new_moon_before(t)

View Source (since 0.5.0)

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 since 0000-01-01

Returns

  • a t:Time.moment() which is a float number of days since 0000-01-01

Example

iex> Astro.Lunar.date_time_new_moon_before 738390
738375.5757777032
Link to this function

first_quarter()

View Source (since 0.5.0)

Specs

first_quarter() :: Astro.phase()

Returns the first quarter lunar phase expressed as a float number of degrees.

Link to this function

full_moon()

View Source (since 0.5.0)

Specs

full_moon() :: Astro.phase()

Returns the full moon lunar phase expressed as a float number of degrees.

Link to this function

illuminated_fraction_of_moon(t)

View Source (since 0.6.0)

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.

Link to this function

last_quarter()

View Source (since 0.5.0)

Specs

last_quarter() :: Astro.phase()

Returns the last quarter lunar phase expressed as a float number of degrees.

Link to this function

lunar_altitude(t, point_z)

View Source (since 0.4.0)

Specs

lunar_altitude(Astro.Time.moment(), Geo.PointZ.t()) :: Astro.angle()
Link to this function

lunar_distance(t)

View Source (since 0.6.0)

Specs

lunar_distance(Astro.Time.moment()) :: Astro.meters()
Link to this function

lunar_latitude(t)

View Source (since 0.6.0)

Specs

lunar_latitude(Astro.Time.moment()) :: Astro.angle()
Link to this function

lunar_parallax(t, location)

View Source
Link to this function

lunar_phase_at(t)

View Source (since 0.5.0)

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 since 0000-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
Link to this function

lunar_position(t)

View Source (since 0.6.0)

Specs

lunar_position(Astro.Time.moment()) ::
  {Astro.angle(), Astro.angle(), Astro.meters()}
Link to this function

new_moon()

View Source (since 0.5.0)

Specs

new_moon() :: Astro.phase()

Returns the new moon lunar phase expressed as a float number of degrees.

Link to this function

topocentric_lunar_altitude(t, location)

View Source