use sciforge::hub::domain::astronomy::celestial::{gravitational_force, tidal_force};
use sciforge::hub::domain::common::constants::{AU, G, SOLAR_MASS};
pub const VENUS_MASS: f64 = crate::VENUS_MASS;
pub const VENUS_RADIUS: f64 = crate::VENUS_RADIUS;
pub const SEMI_MAJOR_AXIS: f64 = crate::SEMI_MAJOR_AXIS_AU * AU;
pub struct SolarTide {
pub distance_m: f64,
}
impl SolarTide {
pub fn at_mean_distance() -> Self {
Self {
distance_m: SEMI_MAJOR_AXIS,
}
}
pub fn at_perihelion() -> Self {
Self {
distance_m: SEMI_MAJOR_AXIS * (1.0 - crate::ECCENTRICITY),
}
}
pub fn at_aphelion() -> Self {
Self {
distance_m: SEMI_MAJOR_AXIS * (1.0 + crate::ECCENTRICITY),
}
}
pub fn at_distance(distance_m: f64) -> Self {
Self { distance_m }
}
pub fn tidal_acceleration(&self) -> f64 {
tidal_force(SOLAR_MASS, self.distance_m, VENUS_RADIUS)
}
pub fn tidal_bulge_height(&self) -> f64 {
let g_surface = G * VENUS_MASS / (VENUS_RADIUS * VENUS_RADIUS);
self.tidal_acceleration() * VENUS_RADIUS / g_surface
}
pub fn gravitational_force(&self) -> f64 {
gravitational_force(SOLAR_MASS, VENUS_MASS, self.distance_m)
}
}
pub fn perihelion_aphelion_tide_ratio() -> f64 {
let peri = SolarTide::at_perihelion();
let aph = SolarTide::at_aphelion();
peri.tidal_acceleration() / aph.tidal_acceleration()
}