With Solarex Elixir package, you can calculate moon phase, sunrise and sunset for particular date and place on the Earth.
The package can be installed by adding solarex
to your list of dependencies in mix.exs
:
def deps do
[
{:solarex, "~> 0.1.1"}
]
end
Solarex.Moon
module is for calculating moon phase using naive approach by calculating the days from the known new moon.
You can specify known new moon using config.exs
use Mix.Config
# Set the date to known new moon
#
config :solarex, known_new_moon: "2019-01-06"
Solarex.Sun
is Elixir implementation of Mike Bostock's Solar Calculator. It can be used for calculating sunrise and sunset for particular date and place on earth (specified by latitude and longitude)
Generated documentation can be found at Hexdocs.
This software is licensed under the MIT license.