sunrise
This is a fork of nathan-osman's crate to test new features.
This crate provides a function for calculating sunrise and sunset times using this method.
You can enable the no-std feature if you need it to work in such a context, it will rely on libm
instead.
Usage
In order to perform the calculation, you'll need to provide the following:
- the date for which you wish to calculate the times
- the latitude and longitude of the location
Begin by adding this crate to Cargo.toml
:
[]
= "1.2"
You can use
the sunrise_sunset
function to perform the calculation:
// Calculate times for January 1, 2016 in Toronto
let = sunrise_sunset;
If you need more refined control, you can use the SolarDay
struct:
use ;
let dawn = new
.with_altitude
.event_time;