From e79b9f025900b7722368f56f16fb48b7e1c7baab Mon Sep 17 00:00:00 2001 From: Thomas Churchman Date: Thu, 31 Oct 2024 11:33:57 +0100 Subject: [PATCH] Only one sqrt --- src/triangle.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/triangle.rs b/src/triangle.rs index 5d3ba01f..50d68e14 100644 --- a/src/triangle.rs +++ b/src/triangle.rs @@ -130,7 +130,7 @@ impl Triangle { let x = (c.y * b_len2 - b.y * c_len2) * d_recip; let y = (b.x * c_len2 - c.x * b_len2) * d_recip; - let r = b_len2.sqrt() * c_len2.sqrt() * (c - b).hypot() * d_recip; + let r = (b_len2 * c_len2).sqrt() * (c - b).hypot() * d_recip; Circle::new(self.a + Vec2::new(x, y), r) }