Skip to content

Commit

Permalink
Only one sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Nov 25, 2024
1 parent d84f1f6 commit e79b9f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e79b9f0

Please sign in to comment.