https://github.com/razican/vsop87-rs

VSOP87 algorithm in Rust

https://github.com/razican/vsop87-rs

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.2%) to scientific vocabulary

Keywords

algorithm hacktoberfest keplerian-elements rust vsop87
Last synced: 6 months ago · JSON representation

Repository

VSOP87 algorithm in Rust

Basic Info
Statistics
  • Stars: 18
  • Watchers: 1
  • Forks: 8
  • Open Issues: 3
  • Releases: 18
Archived
Topics
algorithm hacktoberfest keplerian-elements rust vsop87
Created over 10 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Code of conduct Security

README.md

VSOP87 Rust implementation

Build Status codecov Crates.io Docs.rs

This library implements the VSOP87 solutions to calculate the positions of the planets in the solar system. Full documentation can be found here.

The main module calculates heliocentric ecliptic orbital elements for the equinox J2000.0 for the planets in the solar system, the basic VSOP87 solution. There is one module per other VSOP87 implementation: VSOP87A, VSOP87B, VSOP87C, VSOP87D and VSOP87E. More information can be found here and here.

Each module has its own documentation, and here is the documentation on the base VSOP87 solution. The VSOP87 algorithm has great precision (under 1") for 4,000 years before and after J2000 epoch for Mercury, Venus, Earth-Moon barycenter and Mars, for 2,000 years in the case of Jupiter and Saturn and for 6,000 years for Uranus and Neptune.

The base VSOP87 solution calculates the orbital elements of the planets around the Sun. The returned elements are a special VSOP87 orbital elements, that can be converted into usual keplerian elements using the Into trait. These elements are ideal to get an idea on how the orbits are changing over time. It can also be used for other complex orbital computations.

Example

As an example, here we calculate the orbital parameters for Mercury on the January 1st, 2000. The VSOP87 algorithm requires dates to be entered as Julian Day (JD). In our case, that date is 2451545.0.

We first calculate the VSOP87 elements:

```rust let vsop87_elts = vsop87::mercury(2451545.0);

assert!(vsop87elts.a > 0.3870982121 && vsop87elts.a < 0.3870982123); assert!(vsop87elts.l > 4.4026057778 && vsop87elts.l < 4.4026057780); assert!(vsop87elts.k > 0.0446647517 && vsop87elts.k < 0.0446647519); assert!(vsop87elts.h > 0.2007208957 && vsop87elts.h < 0.2007208959); assert!(vsop87elts.q > 0.0406161540 && vsop87elts.q < 0.0406161542); assert!(vsop87elts.p > 0.04563512 && vsop87elts.p < 0.04563588); ```

Note that the > and < comparisons are there because floats should not be compared using ==. Those numbers are retrieved from the original test data of the VSOP87 algorithm. We can then convert them into keplerian elements, by using both KeplerianElements::from() or the into() function in the VSOP87 elements. This also works the other way around:

```rust use vsop87::{KeplerianElements, VSOP87Elements};

let elements = KeplerianElements::from(vsop87elts); let convertback: VSOP87Elements = elements.into();

assert!(elements.semimajoraxis() > 0.387097 && elements.semimajoraxis() < 0.387099); assert!(elements.eccentricity() > 0.205629 && elements.eccentricity() < 0.205631); assert!(elements.inclination() > 0.122260 && elements.inclination() < 0.122261); assert!(elements.ascendingnode() > 0.843525 && elements.ascendingnode() < 0.843527); assert!(elements.periapsis() > 1.35183 && elements.periapsis() < 1.35185); assert!(elements.meananomaly() > 4.40259 && elements.meananomaly() < 4.40261); ```

As you can see, these numbers perfectly match those from NASA.

License

This library is distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your option. See LICENSE-APACHE, and LICENSE-MIT files for details.

Owner

  • Name: Iban Eguia Moraza
  • Login: Razican
  • Kind: user
  • Location: Switzerland
  • Company: @swisscom

Creator of @OpenStratos, @FrinkGlobal, @SUPERAndroidAnalyzer and official translator in CodeIgniter. Maintainer in @boa-dev, a JS engine written in Rust.

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 112
  • Total Committers: 3
  • Avg Commits per committer: 37.333
  • Development Distribution Score (DDS): 0.446
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Razican r****n@p****h 62
Razican a****n@r****m 44
Iban Eguia Moraza i****a@c****h 6
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 24
  • Total pull requests: 12
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.58
  • Average comments per pull request: 1.33
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Razican (23)
  • rillian (1)
Pull Request Authors
  • dependabot[bot] (7)
  • Razican (5)
  • rillian (3)
Top Labels
Issue Labels
new feature (18) enhancement (6) D - Moderate (3) D - Easy (3) D - Difficult (1)
Pull Request Labels
dependencies (7) github_actions (7) bug (2)

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 33,823 total
  • Total dependent packages: 1
  • Total dependent repositories: 2
  • Total versions: 17
  • Total maintainers: 1
crates.io: vsop87

Pure Rust VSOP87 algorithm implementation. Includes all VSOP87 algorith versions: VSOP87, VSOP87A, VSOP87B, VSOP87C, VSOP87D and VSOP87E. VSOP87 are a family of algorithms used to predict the position of planets in the solar system with great accuracy. That position can be used by astronomical software to create views of the sky, or by simulation software to know the position of the planets.

  • Versions: 17
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 33,823 Total
Rankings
Downloads: 13.3%
Dependent repos count: 13.3%
Average: 17.5%
Forks count: 17.7%
Dependent packages count: 18.2%
Stargazers count: 25.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

Cargo.toml cargo
  • criterion 0.3.3 development
  • rand 0.7.3 development
  • libm 0.2.1
.github/workflows/rust.yml actions
  • Swatinem/rust-cache v2 composite
  • actions-rs/cargo v1 composite
  • actions-rs/toolchain v1.0.7 composite
  • actions/checkout v4 composite
  • baptiste0928/cargo-install v2.2.0 composite
  • codecov/codecov-action v3 composite