How to find plane equation from 8 3D points with least square method

613 Views Asked by At

I have been working on school projects to find a plane equation from 8 3D points. Normally from 3 points, we can create a plane equation but when we have a lot of points, we want to find a good fitting plane for it by using Least Square Method but I’m getting stuck with the procedure to find it. Do we have any ways to find it? Thank you

1

There are 1 best solutions below

1
On

Assume that the equation of the best fitting plane for $n$ points $(x_1,y_1,z_1),(x_2,y_2,z_2),\ldots,(x_n,y_n,z_n)\in\mathbb{R}^3$ can be expressed as $$z=\alpha x + \beta y + \gamma$$ for some coefficients $\alpha,\beta,\gamma\in\mathbb{R}$.

To formulate this as a least squares problem let $A\in M_{n \times 3}(\mathbb{R})$ and $b\in\mathbb{R}^n$ be defined as: $$ A = \begin{pmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ \vdots & \vdots & \vdots \\ x_n & y_n & 1 \\ \end{pmatrix} \quad b = \begin{pmatrix} z_1 \\ z_2 \\ \vdots \\ z_n \\ \end{pmatrix} $$ Now your optimization goal is to find $\min_{x\in\mathbb{R}^3} \left\Vert Ax-b \right\Vert^2$. The components of the result vector $x$ will be the coefficents of the plane equation stated above i.e. $x=(\alpha,\beta,\gamma)$.