Function sun_times::altitude

source ·
pub fn altitude(date_time: DateTime<Utc>, latitude: f64, longitude: f64) -> f64
Expand description

Calculates the altitude (angle from the horizon) of the sun at a given place and moment

Arguments

  • date_time - The date and time on which to calculate the sunset and sunrise
  • latitude - The latitude at which to calculate the times. Expressed as degrees
  • longitude - The longitude at which to calculate the times. Expressed as degrees

Return value

Returns the altitude in degrees

Notes

This currently does not include an altitude correction like the sun_times function does, but is usable within arctic regions

Examples

//Calculate the sunset and sunrise times today at Sheffield university's new computer science building
let altitude = altitude(Utc::now(),53.38,-1.48);
println!("Altitude: {}",altitude);