I am trying to find the constants $a,b,c,d$ in the equation $ax+by+cz=d$ but only know the values of $x,y,z$.
I tried to write it as using matrices as $Ax = B$ where the matrix $A$ is the known values of $x,y,z$, the constants matrix $x=[a, b, c]^T$, and $B$ is a matrix with only values of $d$ equal in rows to $A$.
$A = [2, 0, 1; 1, -1, 1; 1, -2, 2; 2, -1, 2]$
Please let me know if this can be done in general so I can use it to solve given other values of $x,y,z$.
It seems that you have a few points that satisfies the equation and you are trying to find $a,b,c,d$.
Note that if $ax+by+cz=d$ then we have $ax+by+cz-d=0$
That is for each data point, we have $(x_i, y_i, z_i, -1)^T(a,b,c,d)=0$.
$A = \begin{bmatrix}2 & 0 & 1 & -1 \\ 1& -1& 1 & -1 \\ 1& -2& 2 & -1 \\ 2 & -1& 2 & -1\end{bmatrix}, x=(a,b,c,d)^T$ and $B$ is the zero vector.