0

I have many individual datasets of $(x,y,z)$ coordinates. I'd like to see if the coordinates form a plane (and if they do, I'd then like to compute a unit normal to the plane). My original method was to simply fit to $z=ax+by+c$ via least-squares minimization. However, some of my data is nearly vertical in $z$ such that this breaks down. What is the best way to address this without specifically checking every dataset to see if the data forms a vertical plane?

Here is a toy dataset: coords = [3.64811 7.61531 9.05108; 3.53604 4.82801 9.05108; 3.53604 4.82801 6.34192; 3.64811 7.61531 6.34192]

Argon
  • 176
  • 6
  • You ask whether the coordinates are linearly dependent *and* whether they form a plane rather than a point or line. The answers to the duplicate address all these points. – whuber Jan 19 '18 at 21:34
  • Thanks. I ended up going with an orthogonal regression method instead, which actually seems more appropriate with what I'm trying to do. It was easy to implement, and I referred to [this post](https://www.mathworks.com/matlabcentral/answers/297854-best-fitting-a-plane-ax-by-cz-0-where-c-could-be-0) for anyone interested. – Argon Jan 20 '18 at 01:32
  • That is the method I described in the duplicate thread: it computes the singular values (of a centered matrix) and uses relatively small singular values to detect collinearity. – whuber Jan 20 '18 at 13:51

0 Answers0