/*
 * Copyright (c) 2024. Helge Eichhorn and the LOX contributors
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, you can obtain one at https://mozilla.org/MPL/2.0/.
 */

// Auto-generated by `lox-gen`. Do not edit!

use crate::{
    Body, Ellipsoid, NaifId, NutationPrecessionCoefficients, PointMass, PolynomialCoefficients,
    RotationalElements, Spheroid,
};
use std::fmt::{Display, Formatter};
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct Sun;
impl Body for Sun {
    fn id(&self) -> NaifId {
        NaifId(10i32)
    }
    fn name(&self) -> &'static str {
        "Sun"
    }
}
impl Display for Sun {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.name())
    }
}
impl Ellipsoid for Sun {
    fn polar_radius(&self) -> f64 {
        695700f64
    }
    fn mean_radius(&self) -> f64 {
        695700f64
    }
}
impl Spheroid for Sun {
    fn equatorial_radius(&self) -> f64 {
        695700f64
    }
}
impl PointMass for Sun {
    fn gravitational_parameter(&self) -> f64 {
        132712440041.27942f64
    }
}
#[allow(clippy::approx_constant)]
impl RotationalElements for Sun {
    fn nutation_precession_coefficients(&self) -> NutationPrecessionCoefficients {
        (&[] as &[f64], &[] as &[f64])
    }
    fn right_ascension_coefficients(&self) -> PolynomialCoefficients {
        (4.993910588731375f64, 0f64, 0f64, &[] as &[f64])
    }
    fn declination_coefficients(&self) -> PolynomialCoefficients {
        (1.1147417932487782f64, 0f64, 0f64, &[] as &[f64])
    }
    fn prime_meridian_coefficients(&self) -> PolynomialCoefficients {
        (
            1.4691483511587469f64,
            0.24756448241988369f64,
            0f64,
            &[] as &[f64],
        )
    }
}
#[cfg(test)]
#[allow(clippy::approx_constant)]
mod tests {
    use super::*;
    #[test]
    fn test_body_10() {
        assert_eq!(Sun.id(), NaifId(10i32));
        assert_eq!(Sun.name(), "Sun");
        assert_eq!(format!("{}", Sun), "Sun");
    }
    #[test]
    fn test_spheroid_10() {
        assert_eq!(Sun.polar_radius(), 695700f64);
        assert_eq!(Sun.mean_radius(), 695700f64);
        assert_eq!(Sun.equatorial_radius(), 695700f64);
    }
    #[test]
    fn test_point_mass_10() {
        assert_eq!(Sun.gravitational_parameter(), 132712440041.27942f64);
    }
    #[test]
    fn test_rotational_elements_nutation_precession_coefficients_10() {
        assert_eq!(
            (&[] as &[f64], &[] as &[f64]),
            Sun.nutation_precession_coefficients()
        )
    }
    #[test]
    fn test_rotational_elements_right_ascension_coefficients_10() {
        assert_eq!(
            (4.993910588731375f64, 0f64, 0f64, &[] as &[f64]),
            Sun.right_ascension_coefficients()
        )
    }
    #[test]
    fn test_rotational_elements_declination_coefficients_10() {
        assert_eq!(
            (1.1147417932487782f64, 0f64, 0f64, &[] as &[f64]),
            Sun.declination_coefficients()
        )
    }
    #[test]
    fn test_rotational_elements_prime_meridian_coefficients_10() {
        assert_eq!(
            (
                1.4691483511587469f64,
                0.24756448241988369f64,
                0f64,
                &[] as &[f64]
            ),
            Sun.prime_meridian_coefficients()
        )
    }
}
