use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ItrfPositionM {
pub x_m: f64,
pub y_m: f64,
pub z_m: f64,
}
impl ItrfPositionM {
pub const fn new(x_m: f64, y_m: f64, z_m: f64) -> Self {
Self { x_m, y_m, z_m }
}
pub const fn as_array(self) -> [f64; 3] {
[self.x_m, self.y_m, self.z_m]
}
}
impl fmt::Display for ItrfPositionM {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"ITRF[{:.3}, {:.3}, {:.3}] m",
self.x_m, self.y_m, self.z_m
)
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Wgs84Geodetic {
pub lat_rad: f64,
pub lon_rad: f64,
pub height_m: f64,
}
impl Wgs84Geodetic {
pub const fn new(lat_rad: f64, lon_rad: f64, height_m: f64) -> Self {
Self {
lat_rad,
lon_rad,
height_m,
}
}
}
impl fmt::Display for Wgs84Geodetic {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"WGS84[lat {:.6} rad, lon {:.6} rad, h {:.3} m]",
self.lat_rad, self.lon_rad, self.height_m
)
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ItrfVelocityMS {
pub vx_m_s: f64,
pub vy_m_s: f64,
pub vz_m_s: f64,
}
impl ItrfVelocityMS {
pub const fn new(vx_m_s: f64, vy_m_s: f64, vz_m_s: f64) -> Self {
Self {
vx_m_s,
vy_m_s,
vz_m_s,
}
}
pub const fn as_array(self) -> [f64; 3] {
[self.vx_m_s, self.vy_m_s, self.vz_m_s]
}
}