pub fn face_area_normal(a: [f32; 3], b: [f32; 3], c: [f32; 3]) -> [f32; 3]
Expand description
Compute a vector whose direction is the normal of the triangle formed by points a, b, c, and whose magnitude is double the area of the triangle. This is useful for computing smooth normals where the contributing normals are proportionate to the areas of the triangles as discussed here.
Question: Why double the area? Because the area of a triangle A is determined by this equation:
A = |(b - a) x (c - a)| / 2
By computing 2 A we avoid a division operation, and when calculating the the sum of these vectors which are then normalized, a constant multiple has no effect.