From b76d5df47d22a671946e4a8e74f4667047b22781 Mon Sep 17 00:00:00 2001 From: AngusGMorrison Date: Sun, 5 Nov 2023 15:29:17 +0000 Subject: [PATCH] Add POLE_DEC to RotationalElements --- crates/lox_core/src/bodies.rs | 6 +- crates/lox_core/src/bodies/minor.rs | 92 +++- crates/lox_core/src/bodies/planets.rs | 99 ++++- crates/lox_core/src/bodies/satellites.rs | 510 ++++++++++++++++++----- crates/lox_core/src/bodies/sun.rs | 11 +- tools/lox_gen/src/main.rs | 41 +- 6 files changed, 597 insertions(+), 162 deletions(-) diff --git a/crates/lox_core/src/bodies.rs b/crates/lox_core/src/bodies.rs index 97b2da98..2c09a87e 100644 --- a/crates/lox_core/src/bodies.rs +++ b/crates/lox_core/src/bodies.rs @@ -65,11 +65,9 @@ pub fn gravitational_parameter(_: T) -> f64 { /// Semantic type alias for f64 in the context of polynomial types and operations. pub type PolynomialCoefficient = f64; -// Right ascension polynomial coefficients. -pub type RACoefficients = [PolynomialCoefficient; 3]; - pub trait RotationalElements: Copy { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3]; } #[cfg(test)] diff --git a/crates/lox_core/src/bodies/minor.rs b/crates/lox_core/src/bodies/minor.rs index fa60f666..ecf95348 100644 --- a/crates/lox_core/src/bodies/minor.rs +++ b/crates/lox_core/src/bodies/minor.rs @@ -1,5 +1,5 @@ // Auto-generated by `lox_gen`. Do not edit! -use super::{Ellipsoid, NaifId, PointMass, RACoefficients, RotationalElements, TriAxial}; +use super::{Ellipsoid, NaifId, PointMass, PolynomialCoefficient, RotationalElements, TriAxial}; #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Gaspra; impl NaifId for Gaspra { @@ -24,7 +24,8 @@ impl TriAxial for Gaspra { } } impl RotationalElements for Gaspra { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [9.47f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [9.47f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [26.7f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Ida; @@ -50,7 +51,8 @@ impl TriAxial for Ida { } } impl RotationalElements for Ida { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [168.76f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [168.76f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-87.12f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Dactyl; @@ -88,7 +90,8 @@ impl TriAxial for Ceres { } } impl RotationalElements for Ceres { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [291.418f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [291.418f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [66.764f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Pallas; @@ -103,7 +106,8 @@ impl PointMass for Pallas { } } impl RotationalElements for Pallas { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [33f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [33f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-3f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Vesta; @@ -134,7 +138,8 @@ impl TriAxial for Vesta { } } impl RotationalElements for Vesta { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [309.031f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [309.031f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [42.235f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Psyche; @@ -188,7 +193,8 @@ impl TriAxial for Lutetia { } } impl RotationalElements for Lutetia { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [52f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [52f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [12f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Kleopatra; @@ -226,7 +232,8 @@ impl TriAxial for Eros { } } impl RotationalElements for Eros { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [11.35f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [11.35f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [17.22f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Davida; @@ -257,7 +264,8 @@ impl TriAxial for Davida { } } impl RotationalElements for Davida { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [297f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [297f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [5f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Mathilde; @@ -306,7 +314,8 @@ impl TriAxial for Steins { } } impl RotationalElements for Steins { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [91f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [91f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-62f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Braille; @@ -369,7 +378,8 @@ impl TriAxial for Itokawa { } } impl RotationalElements for Itokawa { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [90.53f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [90.53f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-66.3f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Bennu; @@ -393,10 +403,14 @@ mod tests { assert_eq!(Gaspra::along_orbit_radius(), 5.2f64); } #[test] - fn test_ra_coefficients_9511010() { + fn test_right_ascension_coefficients_9511010() { assert_eq!([9.47f64, 0f64, 0f64], Gaspra::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_9511010() { + assert_eq!([26.7f64, 0f64, 0f64], Gaspra::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2431010() { assert_eq!(Ida::id(), 2431010i32) } @@ -408,10 +422,14 @@ mod tests { assert_eq!(Ida::along_orbit_radius(), 12f64); } #[test] - fn test_ra_coefficients_2431010() { + fn test_right_ascension_coefficients_2431010() { assert_eq!([168.76f64, 0f64, 0f64], Ida::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_2431010() { + assert_eq!([-87.12f64, 0f64, 0f64], Ida::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2431011() { assert_eq!(Dactyl::id(), 2431011i32) } @@ -431,13 +449,17 @@ mod tests { assert_eq!(Ceres::along_orbit_radius(), 487.3f64); } #[test] - fn test_ra_coefficients_2000001() { + fn test_right_ascension_coefficients_2000001() { assert_eq!( [291.418f64, 0f64, 0f64], Ceres::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_2000001() { + assert_eq!([66.764f64, 0f64, 0f64], Ceres::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2000002() { assert_eq!(Pallas::id(), 2000002i32) } @@ -446,10 +468,14 @@ mod tests { assert_eq!(Pallas::gravitational_parameter(), 13.665878145967422f64); } #[test] - fn test_ra_coefficients_2000002() { + fn test_right_ascension_coefficients_2000002() { assert_eq!([33f64, 0f64, 0f64], Pallas::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_2000002() { + assert_eq!([-3f64, 0f64, 0f64], Pallas::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2000004() { assert_eq!(Vesta::id(), 2000004i32) } @@ -465,13 +491,17 @@ mod tests { assert_eq!(Vesta::along_orbit_radius(), 280f64); } #[test] - fn test_ra_coefficients_2000004() { + fn test_right_ascension_coefficients_2000004() { assert_eq!( [309.031f64, 0f64, 0f64], Vesta::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_2000004() { + assert_eq!([42.235f64, 0f64, 0f64], Vesta::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2000016() { assert_eq!(Psyche::id(), 2000016i32) } @@ -498,10 +528,14 @@ mod tests { assert_eq!(Lutetia::along_orbit_radius(), 50.5f64); } #[test] - fn test_ra_coefficients_2000021() { + fn test_right_ascension_coefficients_2000021() { assert_eq!([52f64, 0f64, 0f64], Lutetia::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_2000021() { + assert_eq!([12f64, 0f64, 0f64], Lutetia::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2000216() { assert_eq!(Kleopatra::id(), 2000216i32) } @@ -521,10 +555,14 @@ mod tests { assert_eq!(Eros::along_orbit_radius(), 5.5f64); } #[test] - fn test_ra_coefficients_2000433() { + fn test_right_ascension_coefficients_2000433() { assert_eq!([11.35f64, 0f64, 0f64], Eros::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_2000433() { + assert_eq!([17.22f64, 0f64, 0f64], Eros::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2000511() { assert_eq!(Davida::id(), 2000511i32) } @@ -540,10 +578,14 @@ mod tests { assert_eq!(Davida::along_orbit_radius(), 147f64); } #[test] - fn test_ra_coefficients_2000511() { + fn test_right_ascension_coefficients_2000511() { assert_eq!([297f64, 0f64, 0f64], Davida::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_2000511() { + assert_eq!([5f64, 0f64, 0f64], Davida::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2000253() { assert_eq!(Mathilde::id(), 2000253i32) } @@ -566,10 +608,14 @@ mod tests { assert_eq!(Steins::along_orbit_radius(), 2.73f64); } #[test] - fn test_ra_coefficients_2002867() { + fn test_right_ascension_coefficients_2002867() { assert_eq!([91f64, 0f64, 0f64], Steins::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_2002867() { + assert_eq!([-62f64, 0f64, 0f64], Steins::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2009969() { assert_eq!(Braille::id(), 2009969i32) } @@ -600,13 +646,17 @@ mod tests { assert_eq!(Itokawa::along_orbit_radius(), 0.147f64); } #[test] - fn test_ra_coefficients_2025143() { + fn test_right_ascension_coefficients_2025143() { assert_eq!( [90.53f64, 0f64, 0f64], Itokawa::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_2025143() { + assert_eq!([-66.3f64, 0f64, 0f64], Itokawa::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_2101955() { assert_eq!(Bennu::id(), 2101955i32) } diff --git a/crates/lox_core/src/bodies/planets.rs b/crates/lox_core/src/bodies/planets.rs index 921b468f..0c701316 100644 --- a/crates/lox_core/src/bodies/planets.rs +++ b/crates/lox_core/src/bodies/planets.rs @@ -1,5 +1,5 @@ // Auto-generated by `lox_gen`. Do not edit! -use super::{Ellipsoid, NaifId, PointMass, RACoefficients, RotationalElements, Spheroid}; +use super::{Ellipsoid, NaifId, PointMass, PolynomialCoefficient, RotationalElements, Spheroid}; #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Mercury; impl NaifId for Mercury { @@ -26,7 +26,9 @@ impl Spheroid for Mercury { } } impl RotationalElements for Mercury { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [281.0103f64, -0.0328f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [281.0103f64, -0.0328f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [61.4155f64, -0.0049f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Venus; @@ -54,7 +56,8 @@ impl Spheroid for Venus { } } impl RotationalElements for Venus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [272.76f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [272.76f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [67.16f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Earth; @@ -82,7 +85,8 @@ impl Spheroid for Earth { } } impl RotationalElements for Earth { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [0f64, -0.641f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [0f64, -0.641f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [90f64, -0.557f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Mars; @@ -110,7 +114,10 @@ impl Spheroid for Mars { } } impl RotationalElements for Mars { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [317.269202f64, -0.10927547f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [317.269202f64, -0.10927547f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [54.432516f64, -0.05827105f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Jupiter; @@ -138,7 +145,9 @@ impl Spheroid for Jupiter { } } impl RotationalElements for Jupiter { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.056595f64, -0.006499f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [268.056595f64, -0.006499f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.495303f64, 0.002413f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Saturn; @@ -166,7 +175,8 @@ impl Spheroid for Saturn { } } impl RotationalElements for Saturn { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.589f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.589f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.537f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Uranus; @@ -194,7 +204,8 @@ impl Spheroid for Uranus { } } impl RotationalElements for Uranus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.311f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.311f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.175f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Neptune; @@ -222,7 +233,8 @@ impl Spheroid for Neptune { } } impl RotationalElements for Neptune { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [43.46f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Pluto; @@ -250,7 +262,8 @@ impl Spheroid for Pluto { } } impl RotationalElements for Pluto { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [132.993f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [132.993f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-6.163f64, 0f64, 0f64]; } #[cfg(test)] mod tests { @@ -270,13 +283,20 @@ mod tests { assert_eq!(Mercury::equatorial_radius(), 2440.53f64); } #[test] - fn test_ra_coefficients_199() { + fn test_right_ascension_coefficients_199() { assert_eq!( [281.0103f64, -0.0328f64, 0f64], Mercury::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_199() { + assert_eq!( + [61.4155f64, -0.0049f64, 0f64], + Mercury::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_299() { assert_eq!(Venus::id(), 299i32) } @@ -291,10 +311,14 @@ mod tests { assert_eq!(Venus::equatorial_radius(), 6051.8f64); } #[test] - fn test_ra_coefficients_299() { + fn test_right_ascension_coefficients_299() { assert_eq!([272.76f64, 0f64, 0f64], Venus::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_299() { + assert_eq!([67.16f64, 0f64, 0f64], Venus::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_399() { assert_eq!(Earth::id(), 399i32) } @@ -309,10 +333,14 @@ mod tests { assert_eq!(Earth::equatorial_radius(), 6378.1366f64); } #[test] - fn test_ra_coefficients_399() { + fn test_right_ascension_coefficients_399() { assert_eq!([0f64, -0.641f64, 0f64], Earth::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_399() { + assert_eq!([90f64, -0.557f64, 0f64], Earth::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_499() { assert_eq!(Mars::id(), 499i32) } @@ -327,13 +355,20 @@ mod tests { assert_eq!(Mars::equatorial_radius(), 3396.19f64); } #[test] - fn test_ra_coefficients_499() { + fn test_right_ascension_coefficients_499() { assert_eq!( [317.269202f64, -0.10927547f64, 0f64], Mars::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_499() { + assert_eq!( + [54.432516f64, -0.05827105f64, 0f64], + Mars::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_599() { assert_eq!(Jupiter::id(), 599i32) } @@ -348,13 +383,20 @@ mod tests { assert_eq!(Jupiter::equatorial_radius(), 71492f64); } #[test] - fn test_ra_coefficients_599() { + fn test_right_ascension_coefficients_599() { assert_eq!( [268.056595f64, -0.006499f64, 0f64], Jupiter::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_599() { + assert_eq!( + [64.495303f64, 0.002413f64, 0f64], + Jupiter::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_699() { assert_eq!(Saturn::id(), 699i32) } @@ -369,13 +411,20 @@ mod tests { assert_eq!(Saturn::equatorial_radius(), 60268f64); } #[test] - fn test_ra_coefficients_699() { + fn test_right_ascension_coefficients_699() { assert_eq!( [40.589f64, -0.036f64, 0f64], Saturn::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_699() { + assert_eq!( + [83.537f64, -0.004f64, 0f64], + Saturn::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_799() { assert_eq!(Uranus::id(), 799i32) } @@ -390,13 +439,17 @@ mod tests { assert_eq!(Uranus::equatorial_radius(), 25559f64); } #[test] - fn test_ra_coefficients_799() { + fn test_right_ascension_coefficients_799() { assert_eq!( [257.311f64, 0f64, 0f64], Uranus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_799() { + assert_eq!([-15.175f64, 0f64, 0f64], Uranus::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_899() { assert_eq!(Neptune::id(), 899i32) } @@ -411,13 +464,17 @@ mod tests { assert_eq!(Neptune::equatorial_radius(), 24764f64); } #[test] - fn test_ra_coefficients_899() { + fn test_right_ascension_coefficients_899() { assert_eq!( [299.36f64, 0f64, 0f64], Neptune::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_899() { + assert_eq!([43.46f64, 0f64, 0f64], Neptune::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_999() { assert_eq!(Pluto::id(), 999i32) } @@ -432,10 +489,14 @@ mod tests { assert_eq!(Pluto::equatorial_radius(), 1188.3f64); } #[test] - fn test_ra_coefficients_999() { + fn test_right_ascension_coefficients_999() { assert_eq!( [132.993f64, 0f64, 0f64], Pluto::RIGHT_ASCENSION_COEFFICIENTS ) } + #[test] + fn test_declination_coefficients_999() { + assert_eq!([-6.163f64, 0f64, 0f64], Pluto::DECLINATION_COEFFICIENTS) + } } diff --git a/crates/lox_core/src/bodies/satellites.rs b/crates/lox_core/src/bodies/satellites.rs index dc56c64c..64f18c0e 100644 --- a/crates/lox_core/src/bodies/satellites.rs +++ b/crates/lox_core/src/bodies/satellites.rs @@ -1,5 +1,5 @@ // Auto-generated by `lox_gen`. Do not edit! -use super::{Ellipsoid, NaifId, PointMass, RACoefficients, RotationalElements, TriAxial}; +use super::{Ellipsoid, NaifId, PointMass, PolynomialCoefficient, RotationalElements, TriAxial}; #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Moon; impl NaifId for Moon { @@ -29,7 +29,8 @@ impl TriAxial for Moon { } } impl RotationalElements for Moon { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [269.9949f64, 0.0031f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [269.9949f64, 0.0031f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [66.5392f64, 0.013f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Phobos; @@ -60,7 +61,10 @@ impl TriAxial for Phobos { } } impl RotationalElements for Phobos { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [317.67071657f64, -0.10844326f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [317.67071657f64, -0.10844326f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [52.88627266f64, -0.06134706f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Deimos; @@ -91,7 +95,10 @@ impl TriAxial for Deimos { } } impl RotationalElements for Deimos { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [316.65705808f64, -0.10518014f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [316.65705808f64, -0.10518014f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = + [53.50992033f64, -0.05979094f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Io; @@ -122,7 +129,8 @@ impl TriAxial for Io { } } impl RotationalElements for Io { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.05f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.05f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.5f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Europa; @@ -153,7 +161,8 @@ impl TriAxial for Europa { } } impl RotationalElements for Europa { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.08f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.08f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.51f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Ganymede; @@ -184,7 +193,8 @@ impl TriAxial for Ganymede { } } impl RotationalElements for Ganymede { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.2f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.2f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.57f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Callisto; @@ -215,7 +225,8 @@ impl TriAxial for Callisto { } } impl RotationalElements for Callisto { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.72f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.72f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.83f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Amalthea; @@ -246,7 +257,8 @@ impl TriAxial for Amalthea { } } impl RotationalElements for Amalthea { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.05f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.05f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.49f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Himalia; @@ -466,7 +478,8 @@ impl TriAxial for Thebe { } } impl RotationalElements for Thebe { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.05f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.05f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.49f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Adrastea; @@ -497,7 +510,8 @@ impl TriAxial for Adrastea { } } impl RotationalElements for Adrastea { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.05f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.05f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.49f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Metis; @@ -528,7 +542,8 @@ impl TriAxial for Metis { } } impl RotationalElements for Metis { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [268.05f64, -0.009f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [268.05f64, -0.009f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [64.49f64, 0.003f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Callirrhoe; @@ -804,7 +819,8 @@ impl TriAxial for Mimas { } } impl RotationalElements for Mimas { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.66f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.66f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.52f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Enceladus; @@ -835,7 +851,8 @@ impl TriAxial for Enceladus { } } impl RotationalElements for Enceladus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.66f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.66f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.52f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Tethys; @@ -866,7 +883,8 @@ impl TriAxial for Tethys { } } impl RotationalElements for Tethys { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.66f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.66f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.52f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Dione; @@ -897,7 +915,8 @@ impl TriAxial for Dione { } } impl RotationalElements for Dione { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.66f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.66f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.52f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Rhea; @@ -928,7 +947,8 @@ impl TriAxial for Rhea { } } impl RotationalElements for Rhea { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.38f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.38f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.55f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Titan; @@ -959,7 +979,8 @@ impl TriAxial for Titan { } } impl RotationalElements for Titan { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [39.4827f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [39.4827f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.4279f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Hyperion; @@ -1018,7 +1039,8 @@ impl TriAxial for Iapetus { } } impl RotationalElements for Iapetus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [318.16f64, -3.949f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [318.16f64, -3.949f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [75.03f64, -1.143f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Phoebe; @@ -1049,7 +1071,8 @@ impl TriAxial for Phoebe { } } impl RotationalElements for Phoebe { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [356.9f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [356.9f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [77.8f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Janus; @@ -1080,7 +1103,8 @@ impl TriAxial for Janus { } } impl RotationalElements for Janus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.58f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.58f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.52f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Epimetheus; @@ -1111,7 +1135,8 @@ impl TriAxial for Epimetheus { } } impl RotationalElements for Epimetheus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.58f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.58f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.52f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Helene; @@ -1142,7 +1167,8 @@ impl TriAxial for Helene { } } impl RotationalElements for Helene { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.85f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.85f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.34f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Telesto; @@ -1168,7 +1194,8 @@ impl TriAxial for Telesto { } } impl RotationalElements for Telesto { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [50.51f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [50.51f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [84.06f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Calypso; @@ -1194,7 +1221,8 @@ impl TriAxial for Calypso { } } impl RotationalElements for Calypso { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [36.41f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [36.41f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [85.04f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Atlas; @@ -1225,7 +1253,8 @@ impl TriAxial for Atlas { } } impl RotationalElements for Atlas { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.58f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.58f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.53f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Prometheus; @@ -1256,7 +1285,8 @@ impl TriAxial for Prometheus { } } impl RotationalElements for Prometheus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.58f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.58f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.53f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Pandora; @@ -1287,7 +1317,8 @@ impl TriAxial for Pandora { } } impl RotationalElements for Pandora { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.58f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.58f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.53f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Pan; @@ -1313,7 +1344,8 @@ impl TriAxial for Pan { } } impl RotationalElements for Pan { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [40.6f64, -0.036f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [40.6f64, -0.036f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [83.5f64, -0.004f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Ymir; @@ -1685,7 +1717,8 @@ impl TriAxial for Ariel { } } impl RotationalElements for Ariel { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.43f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.43f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.1f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Umbriel; @@ -1716,7 +1749,8 @@ impl TriAxial for Umbriel { } } impl RotationalElements for Umbriel { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.43f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.43f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.1f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Titania; @@ -1747,7 +1781,8 @@ impl TriAxial for Titania { } } impl RotationalElements for Titania { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.43f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.43f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.1f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Oberon; @@ -1778,7 +1813,8 @@ impl TriAxial for Oberon { } } impl RotationalElements for Oberon { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.43f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.43f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.1f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Miranda; @@ -1809,7 +1845,8 @@ impl TriAxial for Miranda { } } impl RotationalElements for Miranda { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.43f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.43f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.08f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Cordelia; @@ -1835,7 +1872,8 @@ impl TriAxial for Cordelia { } } impl RotationalElements for Cordelia { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Ophelia; @@ -1861,7 +1899,8 @@ impl TriAxial for Ophelia { } } impl RotationalElements for Ophelia { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Bianca; @@ -1887,7 +1926,8 @@ impl TriAxial for Bianca { } } impl RotationalElements for Bianca { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Cressida; @@ -1913,7 +1953,8 @@ impl TriAxial for Cressida { } } impl RotationalElements for Cressida { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Desdemona; @@ -1939,7 +1980,8 @@ impl TriAxial for Desdemona { } } impl RotationalElements for Desdemona { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Juliet; @@ -1965,7 +2007,8 @@ impl TriAxial for Juliet { } } impl RotationalElements for Juliet { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Portia; @@ -1991,7 +2034,8 @@ impl TriAxial for Portia { } } impl RotationalElements for Portia { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Rosalind; @@ -2017,7 +2061,8 @@ impl TriAxial for Rosalind { } } impl RotationalElements for Rosalind { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Belinda; @@ -2043,7 +2088,8 @@ impl TriAxial for Belinda { } } impl RotationalElements for Belinda { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Puck; @@ -2069,7 +2115,8 @@ impl TriAxial for Puck { } } impl RotationalElements for Puck { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [257.31f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [257.31f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-15.18f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Caliban; @@ -2184,7 +2231,8 @@ impl TriAxial for Triton { } } impl RotationalElements for Triton { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [41.17f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Nereid; @@ -2238,7 +2286,8 @@ impl TriAxial for Naiad { } } impl RotationalElements for Naiad { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [43.36f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Thalassa; @@ -2269,7 +2318,8 @@ impl TriAxial for Thalassa { } } impl RotationalElements for Thalassa { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [43.45f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Despina; @@ -2300,7 +2350,8 @@ impl TriAxial for Despina { } } impl RotationalElements for Despina { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [43.45f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Galatea; @@ -2331,7 +2382,8 @@ impl TriAxial for Galatea { } } impl RotationalElements for Galatea { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [43.43f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Larissa; @@ -2362,7 +2414,8 @@ impl TriAxial for Larissa { } } impl RotationalElements for Larissa { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.36f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.36f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [43.41f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Proteus; @@ -2393,7 +2446,8 @@ impl TriAxial for Proteus { } } impl RotationalElements for Proteus { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [299.27f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [299.27f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [42.91f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Halimede; @@ -2459,7 +2513,8 @@ impl TriAxial for Charon { } } impl RotationalElements for Charon { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [132.993f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [132.993f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [-6.163f64, 0f64, 0f64]; } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Nix; @@ -2528,13 +2583,17 @@ mod tests { assert_eq!(Moon::along_orbit_radius(), 1737.4f64); } #[test] - fn test_ra_coefficients_301() { + fn test_right_ascension_coefficients_301() { assert_eq!( [269.9949f64, 0.0031f64, 0f64], Moon::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_301() { + assert_eq!([66.5392f64, 0.013f64, 0f64], Moon::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_401() { assert_eq!(Phobos::id(), 401i32) } @@ -2550,13 +2609,20 @@ mod tests { assert_eq!(Phobos::along_orbit_radius(), 11.4f64); } #[test] - fn test_ra_coefficients_401() { + fn test_right_ascension_coefficients_401() { assert_eq!( [317.67071657f64, -0.10844326f64, 0f64], Phobos::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_401() { + assert_eq!( + [52.88627266f64, -0.06134706f64, 0f64], + Phobos::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_402() { assert_eq!(Deimos::id(), 402i32) } @@ -2572,13 +2638,20 @@ mod tests { assert_eq!(Deimos::along_orbit_radius(), 6f64); } #[test] - fn test_ra_coefficients_402() { + fn test_right_ascension_coefficients_402() { assert_eq!( [316.65705808f64, -0.10518014f64, 0f64], Deimos::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_402() { + assert_eq!( + [53.50992033f64, -0.05979094f64, 0f64], + Deimos::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_501() { assert_eq!(Io::id(), 501i32) } @@ -2594,13 +2667,17 @@ mod tests { assert_eq!(Io::along_orbit_radius(), 1819.4f64); } #[test] - fn test_ra_coefficients_501() { + fn test_right_ascension_coefficients_501() { assert_eq!( [268.05f64, -0.009f64, 0f64], Io::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_501() { + assert_eq!([64.5f64, 0.003f64, 0f64], Io::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_502() { assert_eq!(Europa::id(), 502i32) } @@ -2616,13 +2693,17 @@ mod tests { assert_eq!(Europa::along_orbit_radius(), 1560.3f64); } #[test] - fn test_ra_coefficients_502() { + fn test_right_ascension_coefficients_502() { assert_eq!( [268.08f64, -0.009f64, 0f64], Europa::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_502() { + assert_eq!([64.51f64, 0.003f64, 0f64], Europa::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_503() { assert_eq!(Ganymede::id(), 503i32) } @@ -2638,13 +2719,20 @@ mod tests { assert_eq!(Ganymede::along_orbit_radius(), 2631.2f64); } #[test] - fn test_ra_coefficients_503() { + fn test_right_ascension_coefficients_503() { assert_eq!( [268.2f64, -0.009f64, 0f64], Ganymede::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_503() { + assert_eq!( + [64.57f64, 0.003f64, 0f64], + Ganymede::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_504() { assert_eq!(Callisto::id(), 504i32) } @@ -2660,13 +2748,20 @@ mod tests { assert_eq!(Callisto::along_orbit_radius(), 2410.3f64); } #[test] - fn test_ra_coefficients_504() { + fn test_right_ascension_coefficients_504() { assert_eq!( [268.72f64, -0.009f64, 0f64], Callisto::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_504() { + assert_eq!( + [64.83f64, 0.003f64, 0f64], + Callisto::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_505() { assert_eq!(Amalthea::id(), 505i32) } @@ -2682,13 +2777,20 @@ mod tests { assert_eq!(Amalthea::along_orbit_radius(), 73f64); } #[test] - fn test_ra_coefficients_505() { + fn test_right_ascension_coefficients_505() { assert_eq!( [268.05f64, -0.009f64, 0f64], Amalthea::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_505() { + assert_eq!( + [64.49f64, 0.003f64, 0f64], + Amalthea::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_506() { assert_eq!(Himalia::id(), 506i32) } @@ -2796,13 +2898,17 @@ mod tests { assert_eq!(Thebe::along_orbit_radius(), 49f64); } #[test] - fn test_ra_coefficients_514() { + fn test_right_ascension_coefficients_514() { assert_eq!( [268.05f64, -0.009f64, 0f64], Thebe::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_514() { + assert_eq!([64.49f64, 0.003f64, 0f64], Thebe::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_515() { assert_eq!(Adrastea::id(), 515i32) } @@ -2818,13 +2924,20 @@ mod tests { assert_eq!(Adrastea::along_orbit_radius(), 8f64); } #[test] - fn test_ra_coefficients_515() { + fn test_right_ascension_coefficients_515() { assert_eq!( [268.05f64, -0.009f64, 0f64], Adrastea::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_515() { + assert_eq!( + [64.49f64, 0.003f64, 0f64], + Adrastea::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_516() { assert_eq!(Metis::id(), 516i32) } @@ -2840,13 +2953,17 @@ mod tests { assert_eq!(Metis::along_orbit_radius(), 20f64); } #[test] - fn test_ra_coefficients_516() { + fn test_right_ascension_coefficients_516() { assert_eq!( [268.05f64, -0.009f64, 0f64], Metis::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_516() { + assert_eq!([64.49f64, 0.003f64, 0f64], Metis::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_517() { assert_eq!(Callirrhoe::id(), 517i32) } @@ -3002,13 +3119,17 @@ mod tests { assert_eq!(Mimas::along_orbit_radius(), 196.7f64); } #[test] - fn test_ra_coefficients_601() { + fn test_right_ascension_coefficients_601() { assert_eq!( [40.66f64, -0.036f64, 0f64], Mimas::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_601() { + assert_eq!([83.52f64, -0.004f64, 0f64], Mimas::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_602() { assert_eq!(Enceladus::id(), 602i32) } @@ -3024,13 +3145,20 @@ mod tests { assert_eq!(Enceladus::along_orbit_radius(), 251.4f64); } #[test] - fn test_ra_coefficients_602() { + fn test_right_ascension_coefficients_602() { assert_eq!( [40.66f64, -0.036f64, 0f64], Enceladus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_602() { + assert_eq!( + [83.52f64, -0.004f64, 0f64], + Enceladus::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_603() { assert_eq!(Tethys::id(), 603i32) } @@ -3046,13 +3174,20 @@ mod tests { assert_eq!(Tethys::along_orbit_radius(), 528.3f64); } #[test] - fn test_ra_coefficients_603() { + fn test_right_ascension_coefficients_603() { assert_eq!( [40.66f64, -0.036f64, 0f64], Tethys::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_603() { + assert_eq!( + [83.52f64, -0.004f64, 0f64], + Tethys::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_604() { assert_eq!(Dione::id(), 604i32) } @@ -3068,13 +3203,17 @@ mod tests { assert_eq!(Dione::along_orbit_radius(), 561.3f64); } #[test] - fn test_ra_coefficients_604() { + fn test_right_ascension_coefficients_604() { assert_eq!( [40.66f64, -0.036f64, 0f64], Dione::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_604() { + assert_eq!([83.52f64, -0.004f64, 0f64], Dione::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_605() { assert_eq!(Rhea::id(), 605i32) } @@ -3090,13 +3229,17 @@ mod tests { assert_eq!(Rhea::along_orbit_radius(), 763.1f64); } #[test] - fn test_ra_coefficients_605() { + fn test_right_ascension_coefficients_605() { assert_eq!( [40.38f64, -0.036f64, 0f64], Rhea::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_605() { + assert_eq!([83.55f64, -0.004f64, 0f64], Rhea::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_606() { assert_eq!(Titan::id(), 606i32) } @@ -3112,13 +3255,17 @@ mod tests { assert_eq!(Titan::along_orbit_radius(), 2574.78f64); } #[test] - fn test_ra_coefficients_606() { + fn test_right_ascension_coefficients_606() { assert_eq!( [39.4827f64, 0f64, 0f64], Titan::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_606() { + assert_eq!([83.4279f64, 0f64, 0f64], Titan::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_607() { assert_eq!(Hyperion::id(), 607i32) } @@ -3149,13 +3296,20 @@ mod tests { assert_eq!(Iapetus::along_orbit_radius(), 745.7f64); } #[test] - fn test_ra_coefficients_608() { + fn test_right_ascension_coefficients_608() { assert_eq!( [318.16f64, -3.949f64, 0f64], Iapetus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_608() { + assert_eq!( + [75.03f64, -1.143f64, 0f64], + Iapetus::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_609() { assert_eq!(Phoebe::id(), 609i32) } @@ -3171,10 +3325,14 @@ mod tests { assert_eq!(Phoebe::along_orbit_radius(), 108.5f64); } #[test] - fn test_ra_coefficients_609() { + fn test_right_ascension_coefficients_609() { assert_eq!([356.9f64, 0f64, 0f64], Phoebe::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_609() { + assert_eq!([77.8f64, 0f64, 0f64], Phoebe::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_610() { assert_eq!(Janus::id(), 610i32) } @@ -3190,13 +3348,17 @@ mod tests { assert_eq!(Janus::along_orbit_radius(), 93f64); } #[test] - fn test_ra_coefficients_610() { + fn test_right_ascension_coefficients_610() { assert_eq!( [40.58f64, -0.036f64, 0f64], Janus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_610() { + assert_eq!([83.52f64, -0.004f64, 0f64], Janus::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_611() { assert_eq!(Epimetheus::id(), 611i32) } @@ -3215,13 +3377,20 @@ mod tests { assert_eq!(Epimetheus::along_orbit_radius(), 57.3f64); } #[test] - fn test_ra_coefficients_611() { + fn test_right_ascension_coefficients_611() { assert_eq!( [40.58f64, -0.036f64, 0f64], Epimetheus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_611() { + assert_eq!( + [83.52f64, -0.004f64, 0f64], + Epimetheus::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_612() { assert_eq!(Helene::id(), 612i32) } @@ -3237,13 +3406,20 @@ mod tests { assert_eq!(Helene::along_orbit_radius(), 19.6f64); } #[test] - fn test_ra_coefficients_612() { + fn test_right_ascension_coefficients_612() { assert_eq!( [40.85f64, -0.036f64, 0f64], Helene::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_612() { + assert_eq!( + [83.34f64, -0.004f64, 0f64], + Helene::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_613() { assert_eq!(Telesto::id(), 613i32) } @@ -3255,13 +3431,20 @@ mod tests { assert_eq!(Telesto::along_orbit_radius(), 11.8f64); } #[test] - fn test_ra_coefficients_613() { + fn test_right_ascension_coefficients_613() { assert_eq!( [50.51f64, -0.036f64, 0f64], Telesto::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_613() { + assert_eq!( + [84.06f64, -0.004f64, 0f64], + Telesto::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_614() { assert_eq!(Calypso::id(), 614i32) } @@ -3273,13 +3456,20 @@ mod tests { assert_eq!(Calypso::along_orbit_radius(), 9.3f64); } #[test] - fn test_ra_coefficients_614() { + fn test_right_ascension_coefficients_614() { assert_eq!( [36.41f64, -0.036f64, 0f64], Calypso::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_614() { + assert_eq!( + [85.04f64, -0.004f64, 0f64], + Calypso::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_615() { assert_eq!(Atlas::id(), 615i32) } @@ -3295,13 +3485,17 @@ mod tests { assert_eq!(Atlas::along_orbit_radius(), 17.8f64); } #[test] - fn test_ra_coefficients_615() { + fn test_right_ascension_coefficients_615() { assert_eq!( [40.58f64, -0.036f64, 0f64], Atlas::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_615() { + assert_eq!([83.53f64, -0.004f64, 0f64], Atlas::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_616() { assert_eq!(Prometheus::id(), 616i32) } @@ -3317,13 +3511,20 @@ mod tests { assert_eq!(Prometheus::along_orbit_radius(), 41.6f64); } #[test] - fn test_ra_coefficients_616() { + fn test_right_ascension_coefficients_616() { assert_eq!( [40.58f64, -0.036f64, 0f64], Prometheus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_616() { + assert_eq!( + [83.53f64, -0.004f64, 0f64], + Prometheus::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_617() { assert_eq!(Pandora::id(), 617i32) } @@ -3339,13 +3540,20 @@ mod tests { assert_eq!(Pandora::along_orbit_radius(), 40.8f64); } #[test] - fn test_ra_coefficients_617() { + fn test_right_ascension_coefficients_617() { assert_eq!( [40.58f64, -0.036f64, 0f64], Pandora::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_617() { + assert_eq!( + [83.53f64, -0.004f64, 0f64], + Pandora::DECLINATION_COEFFICIENTS + ) + } + #[test] fn test_naif_id_618() { assert_eq!(Pan::id(), 618i32) } @@ -3357,13 +3565,17 @@ mod tests { assert_eq!(Pan::along_orbit_radius(), 15.4f64); } #[test] - fn test_ra_coefficients_618() { + fn test_right_ascension_coefficients_618() { assert_eq!( [40.6f64, -0.036f64, 0f64], Pan::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_618() { + assert_eq!([83.5f64, -0.004f64, 0f64], Pan::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_619() { assert_eq!(Ymir::id(), 619i32) } @@ -3561,10 +3773,14 @@ mod tests { assert_eq!(Ariel::along_orbit_radius(), 577.9f64); } #[test] - fn test_ra_coefficients_701() { + fn test_right_ascension_coefficients_701() { assert_eq!([257.43f64, 0f64, 0f64], Ariel::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_701() { + assert_eq!([-15.1f64, 0f64, 0f64], Ariel::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_702() { assert_eq!(Umbriel::id(), 702i32) } @@ -3580,13 +3796,17 @@ mod tests { assert_eq!(Umbriel::along_orbit_radius(), 584.7f64); } #[test] - fn test_ra_coefficients_702() { + fn test_right_ascension_coefficients_702() { assert_eq!( [257.43f64, 0f64, 0f64], Umbriel::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_702() { + assert_eq!([-15.1f64, 0f64, 0f64], Umbriel::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_703() { assert_eq!(Titania::id(), 703i32) } @@ -3602,13 +3822,17 @@ mod tests { assert_eq!(Titania::along_orbit_radius(), 788.9f64); } #[test] - fn test_ra_coefficients_703() { + fn test_right_ascension_coefficients_703() { assert_eq!( [257.43f64, 0f64, 0f64], Titania::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_703() { + assert_eq!([-15.1f64, 0f64, 0f64], Titania::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_704() { assert_eq!(Oberon::id(), 704i32) } @@ -3624,13 +3848,17 @@ mod tests { assert_eq!(Oberon::along_orbit_radius(), 761.4f64); } #[test] - fn test_ra_coefficients_704() { + fn test_right_ascension_coefficients_704() { assert_eq!( [257.43f64, 0f64, 0f64], Oberon::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_704() { + assert_eq!([-15.1f64, 0f64, 0f64], Oberon::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_705() { assert_eq!(Miranda::id(), 705i32) } @@ -3646,13 +3874,17 @@ mod tests { assert_eq!(Miranda::along_orbit_radius(), 234.2f64); } #[test] - fn test_ra_coefficients_705() { + fn test_right_ascension_coefficients_705() { assert_eq!( [257.43f64, 0f64, 0f64], Miranda::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_705() { + assert_eq!([-15.08f64, 0f64, 0f64], Miranda::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_706() { assert_eq!(Cordelia::id(), 706i32) } @@ -3664,13 +3896,17 @@ mod tests { assert_eq!(Cordelia::along_orbit_radius(), 13f64); } #[test] - fn test_ra_coefficients_706() { + fn test_right_ascension_coefficients_706() { assert_eq!( [257.31f64, 0f64, 0f64], Cordelia::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_706() { + assert_eq!([-15.18f64, 0f64, 0f64], Cordelia::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_707() { assert_eq!(Ophelia::id(), 707i32) } @@ -3682,13 +3918,17 @@ mod tests { assert_eq!(Ophelia::along_orbit_radius(), 15f64); } #[test] - fn test_ra_coefficients_707() { + fn test_right_ascension_coefficients_707() { assert_eq!( [257.31f64, 0f64, 0f64], Ophelia::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_707() { + assert_eq!([-15.18f64, 0f64, 0f64], Ophelia::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_708() { assert_eq!(Bianca::id(), 708i32) } @@ -3700,13 +3940,17 @@ mod tests { assert_eq!(Bianca::along_orbit_radius(), 21f64); } #[test] - fn test_ra_coefficients_708() { + fn test_right_ascension_coefficients_708() { assert_eq!( [257.31f64, 0f64, 0f64], Bianca::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_708() { + assert_eq!([-15.18f64, 0f64, 0f64], Bianca::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_709() { assert_eq!(Cressida::id(), 709i32) } @@ -3718,13 +3962,17 @@ mod tests { assert_eq!(Cressida::along_orbit_radius(), 31f64); } #[test] - fn test_ra_coefficients_709() { + fn test_right_ascension_coefficients_709() { assert_eq!( [257.31f64, 0f64, 0f64], Cressida::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_709() { + assert_eq!([-15.18f64, 0f64, 0f64], Cressida::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_710() { assert_eq!(Desdemona::id(), 710i32) } @@ -3736,13 +3984,17 @@ mod tests { assert_eq!(Desdemona::along_orbit_radius(), 27f64); } #[test] - fn test_ra_coefficients_710() { + fn test_right_ascension_coefficients_710() { assert_eq!( [257.31f64, 0f64, 0f64], Desdemona::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_710() { + assert_eq!([-15.18f64, 0f64, 0f64], Desdemona::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_711() { assert_eq!(Juliet::id(), 711i32) } @@ -3754,13 +4006,17 @@ mod tests { assert_eq!(Juliet::along_orbit_radius(), 42f64); } #[test] - fn test_ra_coefficients_711() { + fn test_right_ascension_coefficients_711() { assert_eq!( [257.31f64, 0f64, 0f64], Juliet::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_711() { + assert_eq!([-15.18f64, 0f64, 0f64], Juliet::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_712() { assert_eq!(Portia::id(), 712i32) } @@ -3772,13 +4028,17 @@ mod tests { assert_eq!(Portia::along_orbit_radius(), 54f64); } #[test] - fn test_ra_coefficients_712() { + fn test_right_ascension_coefficients_712() { assert_eq!( [257.31f64, 0f64, 0f64], Portia::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_712() { + assert_eq!([-15.18f64, 0f64, 0f64], Portia::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_713() { assert_eq!(Rosalind::id(), 713i32) } @@ -3790,13 +4050,17 @@ mod tests { assert_eq!(Rosalind::along_orbit_radius(), 27f64); } #[test] - fn test_ra_coefficients_713() { + fn test_right_ascension_coefficients_713() { assert_eq!( [257.31f64, 0f64, 0f64], Rosalind::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_713() { + assert_eq!([-15.18f64, 0f64, 0f64], Rosalind::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_714() { assert_eq!(Belinda::id(), 714i32) } @@ -3808,13 +4072,17 @@ mod tests { assert_eq!(Belinda::along_orbit_radius(), 33f64); } #[test] - fn test_ra_coefficients_714() { + fn test_right_ascension_coefficients_714() { assert_eq!( [257.31f64, 0f64, 0f64], Belinda::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_714() { + assert_eq!([-15.18f64, 0f64, 0f64], Belinda::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_715() { assert_eq!(Puck::id(), 715i32) } @@ -3826,10 +4094,14 @@ mod tests { assert_eq!(Puck::along_orbit_radius(), 77f64); } #[test] - fn test_ra_coefficients_715() { + fn test_right_ascension_coefficients_715() { assert_eq!([257.31f64, 0f64, 0f64], Puck::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_715() { + assert_eq!([-15.18f64, 0f64, 0f64], Puck::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_716() { assert_eq!(Caliban::id(), 716i32) } @@ -3893,13 +4165,17 @@ mod tests { assert_eq!(Triton::along_orbit_radius(), 1352.6f64); } #[test] - fn test_ra_coefficients_801() { + fn test_right_ascension_coefficients_801() { assert_eq!( [299.36f64, 0f64, 0f64], Triton::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_801() { + assert_eq!([41.17f64, 0f64, 0f64], Triton::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_802() { assert_eq!(Nereid::id(), 802i32) } @@ -3926,10 +4202,14 @@ mod tests { assert_eq!(Naiad::along_orbit_radius(), 29f64); } #[test] - fn test_ra_coefficients_803() { + fn test_right_ascension_coefficients_803() { assert_eq!([299.36f64, 0f64, 0f64], Naiad::RIGHT_ASCENSION_COEFFICIENTS) } #[test] + fn test_declination_coefficients_803() { + assert_eq!([43.36f64, 0f64, 0f64], Naiad::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_804() { assert_eq!(Thalassa::id(), 804i32) } @@ -3945,13 +4225,17 @@ mod tests { assert_eq!(Thalassa::along_orbit_radius(), 40f64); } #[test] - fn test_ra_coefficients_804() { + fn test_right_ascension_coefficients_804() { assert_eq!( [299.36f64, 0f64, 0f64], Thalassa::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_804() { + assert_eq!([43.45f64, 0f64, 0f64], Thalassa::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_805() { assert_eq!(Despina::id(), 805i32) } @@ -3967,13 +4251,17 @@ mod tests { assert_eq!(Despina::along_orbit_radius(), 74f64); } #[test] - fn test_ra_coefficients_805() { + fn test_right_ascension_coefficients_805() { assert_eq!( [299.36f64, 0f64, 0f64], Despina::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_805() { + assert_eq!([43.45f64, 0f64, 0f64], Despina::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_806() { assert_eq!(Galatea::id(), 806i32) } @@ -3989,13 +4277,17 @@ mod tests { assert_eq!(Galatea::along_orbit_radius(), 79f64); } #[test] - fn test_ra_coefficients_806() { + fn test_right_ascension_coefficients_806() { assert_eq!( [299.36f64, 0f64, 0f64], Galatea::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_806() { + assert_eq!([43.43f64, 0f64, 0f64], Galatea::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_807() { assert_eq!(Larissa::id(), 807i32) } @@ -4011,13 +4303,17 @@ mod tests { assert_eq!(Larissa::along_orbit_radius(), 96f64); } #[test] - fn test_ra_coefficients_807() { + fn test_right_ascension_coefficients_807() { assert_eq!( [299.36f64, 0f64, 0f64], Larissa::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_807() { + assert_eq!([43.41f64, 0f64, 0f64], Larissa::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_808() { assert_eq!(Proteus::id(), 808i32) } @@ -4033,13 +4329,17 @@ mod tests { assert_eq!(Proteus::along_orbit_radius(), 208f64); } #[test] - fn test_ra_coefficients_808() { + fn test_right_ascension_coefficients_808() { assert_eq!( [299.27f64, 0f64, 0f64], Proteus::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_808() { + assert_eq!([42.91f64, 0f64, 0f64], Proteus::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_809() { assert_eq!(Halimede::id(), 809i32) } @@ -4075,13 +4375,17 @@ mod tests { assert_eq!(Charon::along_orbit_radius(), 606f64); } #[test] - fn test_ra_coefficients_901() { + fn test_right_ascension_coefficients_901() { assert_eq!( [132.993f64, 0f64, 0f64], Charon::RIGHT_ASCENSION_COEFFICIENTS ) } #[test] + fn test_declination_coefficients_901() { + assert_eq!([-6.163f64, 0f64, 0f64], Charon::DECLINATION_COEFFICIENTS) + } + #[test] fn test_naif_id_902() { assert_eq!(Nix::id(), 902i32) } diff --git a/crates/lox_core/src/bodies/sun.rs b/crates/lox_core/src/bodies/sun.rs index b9e1c2cf..cbe8cfcb 100644 --- a/crates/lox_core/src/bodies/sun.rs +++ b/crates/lox_core/src/bodies/sun.rs @@ -1,5 +1,5 @@ // Auto-generated by `lox_gen`. Do not edit! -use super::{Ellipsoid, NaifId, PointMass, RACoefficients, RotationalElements, Spheroid}; +use super::{Ellipsoid, NaifId, PointMass, PolynomialCoefficient, RotationalElements, Spheroid}; #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct Sun; impl NaifId for Sun { @@ -26,7 +26,8 @@ impl Spheroid for Sun { } } impl RotationalElements for Sun { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [286.13f64, 0f64, 0f64]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [286.13f64, 0f64, 0f64]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [63.87f64, 0f64, 0f64]; } #[cfg(test)] mod tests { @@ -46,7 +47,11 @@ mod tests { assert_eq!(Sun::equatorial_radius(), 695700f64); } #[test] - fn test_ra_coefficients_10() { + fn test_right_ascension_coefficients_10() { assert_eq!([286.13f64, 0f64, 0f64], Sun::RIGHT_ASCENSION_COEFFICIENTS) } + #[test] + fn test_declination_coefficients_10() { + assert_eq!([63.87f64, 0f64, 0f64], Sun::DECLINATION_COEFFICIENTS) + } } diff --git a/tools/lox_gen/src/main.rs b/tools/lox_gen/src/main.rs index c1b0dc9c..3e70bfa8 100644 --- a/tools/lox_gen/src/main.rs +++ b/tools/lox_gen/src/main.rs @@ -321,7 +321,7 @@ fn rotational_elements( ) { let shared_imports = vec![ format_ident!("RotationalElements"), - format_ident!("RACoefficients"), + format_ident!("PolynomialCoefficient"), ]; for import in shared_imports { @@ -330,34 +330,51 @@ fn rotational_elements( } } - let (ra_p0, ra_p1, ra_p2) = if let Some(rac) = get_ra_coefficients(id, data) { - rac - } else { - return; // RotationalElements can't be implemented for this body - }; + let right_ascension_key = format!("BODY{}_POLE_RA", *id); + let (ra_p0, ra_p1, ra_p2) = + if let Some(rac) = get_polynomial_coefficients(&right_ascension_key, data) { + rac + } else { + return; // RotationalElements can't be implemented for this body + }; + + let declination_key = format!("BODY{}_POLE_DEC", *id); + let (dec_p0, dec_p1, dec_p2) = + if let Some(dec) = get_polynomial_coefficients(&declination_key, data) { + dec + } else { + return; + }; *code = quote! { #code impl RotationalElements for #ident { - const RIGHT_ASCENSION_COEFFICIENTS: RACoefficients = [#ra_p0, #ra_p1, #ra_p2]; + const RIGHT_ASCENSION_COEFFICIENTS: [PolynomialCoefficient; 3] = [#ra_p0, #ra_p1, #ra_p2]; + const DECLINATION_COEFFICIENTS: [PolynomialCoefficient; 3] = [#dec_p0, #dec_p1, #dec_p2]; } }; - let ra_test_name = format_ident!("test_ra_coefficients_{}", *id as u32); + let right_ascension_test_name = + format_ident!("test_right_ascension_coefficients_{}", *id as u32); + let declination_test_name = format_ident!("test_declination_coefficients_{}", *id as u32); *tests = quote! { #tests #[test] - fn #ra_test_name() { + fn #right_ascension_test_name() { assert_eq!([#ra_p0, #ra_p1, #ra_p2], #ident::RIGHT_ASCENSION_COEFFICIENTS) } + + #[test] + fn #declination_test_name() { + assert_eq!([#dec_p0, #dec_p1, #dec_p2], #ident::DECLINATION_COEFFICIENTS) + } } } -fn get_ra_coefficients(id: &i32, data: &Data) -> Option<(f64, f64, f64)> { - let key = format!("BODY{id}_POLE_RA"); - match data.pck.get_double_array(&key) { +fn get_polynomial_coefficients(key: &str, data: &Data) -> Option<(f64, f64, f64)> { + match data.pck.get_double_array(key) { None => None, Some(polynomials) if polynomials.len() == 2 => Some((polynomials[0], polynomials[1], 0.0)), Some(polynomials) if polynomials.len() == 3 => {