What does it mean to "preconcat" a matrix in Android?
When working with matrices, the word concatenation refers to multiplication.
Since matrix multiplication is not commutative, there is a separate word for backwards multiplication.
Pre-concatenating a
to b
means setting a = b × a
. (As opposed to a = a × b
, which will give a different matrix)
It just another example Google and their development absue words and abbriviations in the code.If I run the authorithy i will impose a fine on this.Basicaly it means multiply the existing matrix from the right side,and because in vector transformation the one on the right side gets moved first so it is a "pre-".For example if you want to scale the image and move to another location you should type:
mCanvas.translate(tx,ty); mCanvas.scale(sx,sy); mCanvas.drawBitmap(mBitmap,0,0,mPaint);
It is excatly in reverse order of common sense logic.