{"id":13438354,"url":"https://github.com/flosse/rust-sun","last_synced_at":"2025-08-21T10:32:03.733Z","repository":{"id":35075321,"uuid":"39225030","full_name":"flosse/rust-sun","owner":"flosse","description":"A Rust library for calculating sun positions","archived":false,"fork":false,"pushed_at":"2023-01-21T00:40:31.000Z","size":18,"stargazers_count":45,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T09:38:39.761Z","etag":null,"topics":["geo","sun","sun-position","sunrise","sunset"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"amiglobe/311JAM2017-TEAM7","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flosse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-16T23:19:38.000Z","updated_at":"2024-01-07T11:51:00.000Z","dependencies_parsed_at":"2023-02-12T07:01:44.415Z","dependency_job_id":null,"html_url":"https://github.com/flosse/rust-sun","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosse%2Frust-sun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosse%2Frust-sun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosse%2Frust-sun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosse%2Frust-sun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flosse","download_url":"https://codeload.github.com/flosse/rust-sun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230507051,"owners_count":18236944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geo","sun","sun-position","sunrise","sunset"],"created_at":"2024-07-31T03:01:04.812Z","updated_at":"2024-12-19T22:08:54.621Z","avatar_url":"https://github.com/flosse.png","language":"Rust","readme":"# sun\n\nA [Rust](https://www.rust-lang.org) port of the JS library [suncalc](https://github.com/mourner/suncalc/).\n\n[![Crates.io](https://img.shields.io/crates/v/sun.svg)](https://crates.io/crates/sun)\n[![Docs.rs](https://docs.rs/sun/badge.svg)](https://docs.rs/sun/)\n\n## Install\n\nAdd the following to your `Cargo.toml`\n\n    [dependencies]\n    sun = \"0.3\"\n\n## Usage\n\n```rust\npub fn main() {\n  let unixtime = 1_362_441_600_000.0;\n  let lat = 48.0;\n  let lon = 9.0;\n  let pos = sun::pos(unixtime,lat,lon);\n  let az  = pos.azimuth.to_degrees();\n  let alt = pos.altitude.to_degrees();\n  println!(\"The position of the sun is {az}/{alt}\");\n\n  let time_ms = sun::time_at_phase(unixtime, sun::SunPhase::Sunrise, lat, lon, 0.0);\n  println!(\"Sunrise is at {time_ms}\");\n}\n```\n","funding_links":[],"categories":["Libraries","库 Libraries","库","人工智能（Artificial Intelligence）"],"sub_categories":["Astronomy","天文学 Astronomy","天文学","天文 Astronomy","天文（Astronomy）"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflosse%2Frust-sun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflosse%2Frust-sun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflosse%2Frust-sun/lists"}