How to solve Ax=0.. with 4 unknowns and 4 linear equations

11.9k Views Asked by At

I am trying to solve 4 linear equations for a 3D triangulation problem to create a function in matlab code.

I have 4 equations such as

aX + bY + cZ + dW = 0

eX + fY + gZ + hW = 0

iX + jY + kZ + lW = 0

mX + nY + oZ + pW = 0

Here, I have to solve for X, Y, Z and W

I am totally new to linear algebra and solving systems linear equations. Please guide me on how to solve this to obtain the 4 unknowns.

Thanks in advance for your valuable time...

2

There are 2 best solutions below

2
On BEST ANSWER

The question was tagged (matlab), so I will provide an appropriate solution.

% construct the matrix
A = [a,b,c,d;
     e,f,g,h;
     i,j,k,l;
     m,n,o,p];

% the solution will be in the nullspace of the matrix A
Z = null(A);

The vectors in the columns of Z form a basis for $\mathcal{N}(A)$, so that the solution to the linear system can be written as $\mathbf{x}=Z\mathbf{c}$, where $\mathbf{c}$ is a column vector with the same number of rows as the columns of $Z$.

This approach is not efficient when $A$ is a large matrix, as the function null computes the singular value decomposition of the matrix. This approach will work when $A$ is both singular and non-singular.

0
On

If you want $some$ solution, $X=Y=Z=W=0$ is one. It is also the only solution if the matrix $$A=\begin{bmatrix}a&b&c&d\\e&f&g&h\\i&j&k&l\\m&n&o&p\end{bmatrix}$$ is invertible. If the matrix $A$ is not invertible, then you have some vectors in its kernel and you have an infinite number of solutions to your question.