Skip to content

Commit

Permalink
Add reference to circumcenter calculation in Triangle3d
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorfhc committed Mar 20, 2024
1 parent 16027c4 commit f843b9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_math/src/primitives/dim3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ impl Triangle3d {
let [a, b, c] = self.vertices;
let ab = b - a;
let ac = c - a;
// Reference: https://gamedev.stackexchange.com/questions/60630/how-do-i-find-the-circumcenter-of-a-triangle-in-3d
let m = a
+ ((ac.length_squared() * ab.cross(ac).cross(ab)
+ ab.length_squared() * ac.cross(ab).cross(ac))
Expand Down

0 comments on commit f843b9c

Please sign in to comment.