-
QMatrix Inverted
I would like to do an inverse of a matrix. I read the QMatrix document (http://doc.qt.io/archives/qt-4.8/qmatrix.html#inverted). They have this inverted function. According to the doc, it supposes to return an inverted copy of the matrix, but it also mentions about returning boolean. How does this work?
-
Re: QMatrix Inverted
If the matrix can be inverted successfully, then the boolean value is set to true and the inverted matrix is returned. If the matrix is singular (or degenerate), then its determinate is zero and it is non-invertible. If the matrix is not square, it is non-invertible. In this case, the function sets the boolean to false. As the docs say, if the matrix is non-invertible, then the method returns the identity matrix and the boolean is set to false.
Wikipedia explains it in more detail.