Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out if a set of point3D are in the same plane?

I have a set of point3D (X, Y, Z). I need to check if they are coplanar with some sort of tolerances. My way of doing it is that: I convert all points from the Global Coordinate System to Local one, where local x,y is in the same plane of the plane defined by 3 points in the set, and z is normal to that plane. And then, all I need to do is to check if all points in the set have approximately similar local z values.

However, the tricky part is how to pick the 3 points to define the reference plane. If picked randomly, this would result in sometimes the set of points are coplanar, sometimes not. Do you have any suggestion?

like image 367
N.T.C Avatar asked Oct 26 '25 08:10

N.T.C


1 Answers

Probably the most common way to do this would be with Principal Component Analysis: https://en.wikipedia.org/wiki/Principal_component_analysis

The short description is:

  1. Calculate the 3x3 covariance matrix of the input points
  2. Extract the smallest Eigenvector. That is the normal vector for the plane that is the Least-Squared-Error fit to all your points.
like image 182
Matt Timmermans Avatar answered Oct 28 '25 02:10

Matt Timmermans