From 1e27657719ab2b92b00a80f7e9dcc4829d4bb445 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Wed, 20 Mar 2024 14:47:00 +0100 Subject: [PATCH] Cleanup --- src/coordinate/coor2d.rs | 2 -- src/coordinate/coor3d.rs | 1 - src/coordinate/mod.rs | 9 ++++++--- src/ellipsoid/geodesics.rs | 4 ++-- src/inner_op/molodensky.rs | 1 - 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/coordinate/coor2d.rs b/src/coordinate/coor2d.rs index 0923c6d..255b503 100644 --- a/src/coordinate/coor2d.rs +++ b/src/coordinate/coor2d.rs @@ -163,10 +163,8 @@ impl Coor2D { pub fn hypot2(&self, other: &Self) -> f64 { (self[0] - other[0]).hypot(self[1] - other[1]) } - } - impl From for Coor4D { fn from(c: Coor2D) -> Self { Coor4D([c[0], c[1], 0.0, 0.0]) diff --git a/src/coordinate/coor3d.rs b/src/coordinate/coor3d.rs index df7486b..f18feca 100644 --- a/src/coordinate/coor3d.rs +++ b/src/coordinate/coor3d.rs @@ -262,7 +262,6 @@ impl Coor3D { .hypot(self[1] - other[1]) .hypot(self[2] - other[2]) } - } // ----- T E S T S --------------------------------------------------- diff --git a/src/coordinate/mod.rs b/src/coordinate/mod.rs index 908c6d2..92d7217 100644 --- a/src/coordinate/mod.rs +++ b/src/coordinate/mod.rs @@ -163,7 +163,12 @@ pub trait CoordTrait { /// Returns a tuple that contains the three first components of the coord converted to f64. fn xyzt_as_f64(&self) -> (f64, f64, f64, f64) { - (self.x_as_f64(), self.y_as_f64(), self.z_as_f64(), self.t_as_f64()) + ( + self.x_as_f64(), + self.y_as_f64(), + self.z_as_f64(), + self.t_as_f64(), + ) } } @@ -207,8 +212,6 @@ impl CoordTrait for Coor2D { } } - - impl CoordTrait for Coor32 { type T = f32; const DIMENSION: usize = 2; diff --git a/src/ellipsoid/geodesics.rs b/src/ellipsoid/geodesics.rs index 33048ed..895f518 100644 --- a/src/ellipsoid/geodesics.rs +++ b/src/ellipsoid/geodesics.rs @@ -206,9 +206,9 @@ impl Ellipsoid { #[must_use] pub fn distance(&self, from: &T, to: &T) -> f64 where - T: CoordTrait + T: CoordTrait, { - self.geodesic_inv::(&from, &to)[2] + self.geodesic_inv::(from, to)[2] } } diff --git a/src/inner_op/molodensky.rs b/src/inner_op/molodensky.rs index 978b823..92c85b2 100644 --- a/src/inner_op/molodensky.rs +++ b/src/inner_op/molodensky.rs @@ -209,7 +209,6 @@ mod tests { use super::*; use crate::math::angular; - #[test] fn molodensky() -> Result<(), Error> { let mut ctx = Minimal::default();