Skip to content
A Rust library for calculating sun positions
Branch: master
Clone or download
Latest commit 6431e8b Feb 12, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore initial commit Jul 16, 2015
.travis.yml remove clippy dependency Nov 11, 2016
Cargo.toml add some more badges Feb 12, 2018 add some more badges Feb 12, 2018
appveyor.yml add appveyor config Feb 12, 2018
dev-env.nix added nix expression Oct 2, 2015


A rust port of the JS library suncalc.

Build Status Build status


Add the following to your Cargo.toml

sun = "0.2"


extern crate sun;

pub fn main() {
  let unixtime = 1362441600000;
  let lat = 48.0;
  let lon = 9.0;
  let pos = sun::pos(unixtime,lat,lon);
  let az  = pos.azimuth.to_degrees();
  let alt = pos.altitude.to_degrees();
  println!("The position of the sun is {}/{}", az, alt);
You can’t perform that action at this time.