diff --git a/crates/fj-math/src/circle.rs b/crates/fj-math/src/circle.rs index 29212cf90..7ae63c8ba 100644 --- a/crates/fj-math/src/circle.rs +++ b/crates/fj-math/src/circle.rs @@ -77,6 +77,20 @@ impl Circle { } } +impl approx::AbsDiffEq for Circle { + type Epsilon = ::Epsilon; + + fn default_epsilon() -> Self::Epsilon { + Scalar::default_epsilon() + } + + fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool { + self.center.abs_diff_eq(&other.center, epsilon) + && self.a.abs_diff_eq(&other.a, epsilon) + && self.b.abs_diff_eq(&other.b, epsilon) + } +} + #[cfg(test)] mod tests { use std::f64::consts::{FRAC_PI_2, PI};