How to check if any number of points are coplanar?

How to check if any number of tridimensional points are coplanar?

I have found just how to check if 4 points are coplanar, but I need to know if a few tenths of points are coplanar.


Solution 1:

I would first do a linear least squares to fit the best approximation plane. I use italic writing as best is a subjective matter. And then test if all the distances of the points to that plane are less than a given tolerance.

The advantage of doing so is that all points are Havin the same role.