Solar - A Solar Event Calculator

Provides sunrise and sunset times for a provided location and date.

The algorithms/math used are from:

https://github.com/mikereedell/sunrisesunsetlib-java

Code has been completely rewritten to take advantage of the Elixir language.

The event function takes a minimum of two parameters, the event of interest which can be either :rise or :set and the latitude and longitude. Additionally a list of options can be provided as follows:

Examples

The following, with out any options and run on December 25:

iex> Solar.event (:rise, {39.1371, -88.65})
{:ok,~T[07:12:26]}

iex> Solar.event (:set, {39.1371, -88.65})
{:ok,~T[16:38:01]}

The coordinates are for Lake Sara, IL where sunrise on this day will be at 7:12:26AM and sunset will be at 4:38:01PM.

The latlong library can be used to convert various latitude and longitude formats to the signed numeric decimal format needed for position in the event call.

Road Map

Installation

If available in Hex, the package can be installed as:

  1. Add solar to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:solar, "~> 0.1.0"}]
end
```