Skip to content

Commit

Permalink
Remove one division
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Nov 25, 2024
1 parent e79b9f0 commit dd9af02
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 @@ -126,7 +126,7 @@ impl Triangle {
let c = self.c - self.a;
let b_len2 = b.hypot2();
let c_len2 = c.hypot2();
let d_recip = 1. / (2. * b.cross(c));
let d_recip = 0.5 / b.cross(c);

let x = (c.y * b_len2 - b.y * c_len2) * d_recip;
let y = (b.x * c_len2 - c.x * b_len2) * d_recip;
Expand Down

0 comments on commit dd9af02

Please sign in to comment.