I'm using the simple matrix x vector multiplication below to calculate result. And now I wonder how can I calculate vector if I know matrix and result ? So when I multiply matrix and vector afterwards again I get result.
Sorry I don't know how you call this multiplication. I was never deep in those math topics. I have a program that does my calculation. I hope you can understand and classify the multiplication:
// float[] matrix = [4x4], float[] vector = [4] column vector
float[] result = new float[vector.Length];
for (int column = 0; column < 4; column++)
{
for (int row = 0; row < 4; row++)
result[column] += matrix[column + row * 4] * vector[row];
}
return result;
Update: I found this for inverted matrices and I now remember mathematicians don't care for complexity of things but we programmers do. Is there no way to avoid matrix inversion (to lessen complexity) ?
Solution: I implemented the raw 4x4 matrix inversion and (alternatively) I inverted the matrix generation. In the end I got the very same matrices and the very same valid results for my vector. I choose the 2nd path because that reduces the complexity to around the same as the calculation done in my first sentence above.
Thank you for the help!
If I understand your question correctly, you have a matrix $A$ and a vector $b$ and want to find the vector $x$ which satisfies $$Ax=b.$$
If the matrix $A$ is invertible, then the equation $Ax=b$ has a unique solution, namely $x=A^{-1}b$. If $A$ is not invertible, there may be either zero or many solutions to your problem.