Skip to main content

coplanar_3d

Function coplanar_3d 

Source
pub fn coplanar_3d<S>(
    a: Point3<S>,
    b: Point3<S>,
    c: Point3<S>,
    d: Point3<S>,
) -> bool
where S: OrderedField + AbsDiffEq<Epsilon = S>,
Expand description

Returns true when four points lie on the same plane in 3D space.

assert!(coplanar_3d (
  [-1.0, -1.0, -1.0].into(),
  [ 1.0,  1.0,  1.0].into(),
  [-1.0,  1.0,  0.0].into(),
  [ 1.0, -1.0,  0.0].into()
));