{"id":16810014,"url":"https://github.com/razican/vsop87-rs","last_synced_at":"2025-03-22T02:31:59.404Z","repository":{"id":55625455,"uuid":"42683275","full_name":"Razican/vsop87-rs","owner":"Razican","description":"VSOP87 algorithm in Rust","archived":false,"fork":false,"pushed_at":"2024-04-15T04:23:02.000Z","size":19114,"stargazers_count":15,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-23T03:03:14.496Z","etag":null,"topics":["algorithm","hacktoberfest","keplerian-elements","rust","vsop87"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/vsop87","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Razican.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-17T21:35:59.000Z","updated_at":"2024-04-17T04:42:23.000Z","dependencies_parsed_at":"2024-10-13T10:14:25.818Z","dependency_job_id":"3f68ba2e-6eca-4f5f-8dfe-127bf2d7a174","html_url":"https://github.com/Razican/vsop87-rs","commit_stats":{"total_commits":112,"total_committers":3,"mean_commits":"37.333333333333336","dds":0.4464285714285714,"last_synced_commit":"d09f556d9e00e55770dea7b018526ed986598d17"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Razican%2Fvsop87-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Razican%2Fvsop87-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Razican%2Fvsop87-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Razican%2Fvsop87-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Razican","download_url":"https://codeload.github.com/Razican/vsop87-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898185,"owners_count":20528331,"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":["algorithm","hacktoberfest","keplerian-elements","rust","vsop87"],"created_at":"2024-10-13T10:14:23.800Z","updated_at":"2025-03-22T02:31:58.361Z","avatar_url":"https://github.com/Razican.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VSOP87 Rust implementation\n\n[![Build Status][build_badge]][build_link]\n[![codecov](https://codecov.io/gh/Razican/vsop87-rs/branch/main/graph/badge.svg)](https://codecov.io/gh/Razican/vsop87-rs)\n[![Crates.io](https://img.shields.io/crates/v/vsop87.svg)](https://crates.io/crates/vsop87)\n[![Docs.rs](https://docs.rs/vsop87/badge.svg)](https://docs.rs/vsop87)\n\n[build_badge]: https://github.com/Razican/vsop87-rs/actions/workflows/rust.yml/badge.svg?event=push\u0026branch=main\n[build_link]: https://github.com/Razican/vsop87-rs/actions/workflows/rust.yml?query=event%3Apush+branch%3Amain\n\nThis library implements the *VSOP87* solutions to calculate the positions of the planets in the\nsolar system. Full **documentation** can be found [here][docs_link].\n\nThe main module calculates heliocentric ecliptic orbital elements for the equinox J2000.0 for\nthe planets in the solar system, the basic *VSOP87* solution. There is one module per other\n*VSOP87* implementation: *VSOP87A*, *VSOP87B*, *VSOP87C*, *VSOP87D* and *VSOP87E*. More\ninformation can be found [here][vsop87_compute] and [here][vsop87_wiki].\n\nEach module has its own documentation, and here is the documentation on the base *VSOP87*\nsolution. The *VSOP87* algorithm has great precision (under 1\") for **4,000 years** before and\nafter J2000 epoch for Mercury, Venus, Earth-Moon barycenter and Mars, for **2,000 years** in\nthe case of Jupiter and Saturn and for **6,000 years** for Uranus and Neptune.\n\nThe base *VSOP87* solution calculates the [orbital elements][orb_elem_wiki] of the planets around\nthe Sun. The returned elements are a special VSOP87 orbital elements, that can be converted into\nusual keplerian elements using the `Into` trait. These elements are ideal to get an idea on how\nthe orbits are changing over time. It can also be used for other complex orbital computations.\n\n## Example\n\nAs an example, here we calculate the orbital parameters for Mercury on the January 1st, 2000.\nThe *VSOP87* algorithm requires dates to be entered as\n[Julian Day][julian_day_wiki] (*JD*). In our case, that date is\n`2451545.0`.\n\nWe first calculate the VSOP87 elements:\n\n```rust\nlet vsop87_elts = vsop87::mercury(2451545.0);\n\nassert!(vsop87_elts.a \u003e 0.3870982121 \u0026\u0026 vsop87_elts.a \u003c 0.3870982123);\nassert!(vsop87_elts.l \u003e 4.4026057778 \u0026\u0026 vsop87_elts.l \u003c 4.4026057780);\nassert!(vsop87_elts.k \u003e 0.0446647517 \u0026\u0026 vsop87_elts.k \u003c 0.0446647519);\nassert!(vsop87_elts.h \u003e 0.2007208957 \u0026\u0026 vsop87_elts.h \u003c 0.2007208959);\nassert!(vsop87_elts.q \u003e 0.0406161540 \u0026\u0026 vsop87_elts.q \u003c 0.0406161542);\nassert!(vsop87_elts.p \u003e 0.04563512 \u0026\u0026 vsop87_elts.p \u003c 0.04563588);\n```\n\nNote that the `\u003e` and `\u003c` comparisons are there because floats should not be compared using\n`==`. Those numbers are retrieved from the original test data of the *VSOP87* algorithm.\nWe can then convert them into keplerian elements, by using both `KeplerianElements::from()` or\nthe `into()` function in the *VSOP87* elements. This also works the other way around:\n\n```rust\nuse vsop87::{KeplerianElements, VSOP87Elements};\n\nlet elements = KeplerianElements::from(vsop87_elts);\nlet convert_back: VSOP87Elements = elements.into();\n\nassert!(elements.semimajor_axis() \u003e 0.387097 \u0026\u0026 elements.semimajor_axis() \u003c 0.387099);\nassert!(elements.eccentricity() \u003e 0.205629 \u0026\u0026 elements.eccentricity() \u003c 0.205631);\nassert!(elements.inclination() \u003e 0.122260 \u0026\u0026 elements.inclination() \u003c 0.122261);\nassert!(elements.ascending_node() \u003e 0.843525 \u0026\u0026 elements.ascending_node() \u003c 0.843527);\nassert!(elements.periapsis() \u003e 1.35183 \u0026\u0026 elements.periapsis() \u003c 1.35185);\nassert!(elements.mean_anomaly() \u003e 4.40259 \u0026\u0026 elements.mean_anomaly() \u003c 4.40261);\n```\n\nAs you can see, these numbers perfectly match [those from NASA][nasa_mercury_facts].\n\n## License\n\nThis library is distributed under the terms of both the MIT license and the\nApache License (Version 2.0), at your option. See LICENSE-APACHE, and LICENSE-MIT files for\ndetails.\n\n[docs_link]: https://docs.rs/vsop87/\n[vsop87_compute]: https://www.caglow.com/info/compute/vsop87\n[vsop87_wiki]: https://en.wikipedia.org/wiki/VSOP_(planets)\n[julian_day_wiki]: https://en.wikipedia.org/wiki/Julian_day\n[orb_elem_wiki]: https://en.wikipedia.org/wiki/Orbital_elements\n[nasa_mercury_facts]: https://solarsystem.nasa.gov/planets/mercury/facts","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazican%2Fvsop87-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazican%2Fvsop87-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazican%2Fvsop87-rs/lists"}