Popularity
2.0
Growing
Activity
5.8
-
47
4
9

Programming language: Rust
License: MIT License
Tags: Astronomy    
Latest version: v0.1.0

rust-sun alternatives and similar packages

Based on the "Astronomy" category.
Alternatively, view rust-sun alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of rust-sun or a related project?

Add another 'Astronomy' Package

README

sun

A rust port of the JS library suncalc.

Build Status Build status

Install

Add the following to your Cargo.toml

[dependencies]
sun = "0.2"

Usage

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);
}