There are already functions to translate(), rotate(), and scale(), but I was looking for a way to mirror coordinates (in 2D), e.g. (x, y) -> (-x, y), or mirroring with respect to an arbitrarily rotated axis.
Finally I found applyMatrix(), which can do this (though some better documentation for the 2D case would be nice, e.g. explain that it takes 6 parameters, and not 9), but the documentation states that:
Quote:This is very slow because it will try to calculate the inverse of the transform, so avoid it whenever possible.
My question is: Why is it necessary to invert the matrix? I can't see why it is necessary to have
both the matrix and its inverse. If only the inverse is needed, then why not provide a function that takes the inverse as its argument, so that numerical inversion can be avoided at runtime?
Any explanations or pointers to documentation would be welcome!
EDIT: Since there are no replies yet, let me clarify a little bit. First I must say that I know nothing about computer graphics, only a little bit of mathematics. If I understand correctly, before anything is plotted, all (x, y) coordinates are transformed by multiplying the vector (x, y, 1) with a 3*3 matrix to get (x', y', 1). This simple operation doesn't require the inverse of the transformation matrix. So where is the inverse used?