You need to understand that most transformations are NOT commutative.
Most mathematical operations are commutative, i.e. the order in which they are applied does not matter. But there is no transformation. The order is very important. The combination of translation and scaling gives different results if you first perform the translation and then the scale, or if you do the opposite.
So this is:
transform: scale(3,3) translate(-170px,-80px);
does not match this:
transform: translate(-170px,-80px) scale(3,3);
In the first case, you first translate and then zoom in. Thus, the initial transformation is multiplied by 3, which is equivalent
transform: translate(-510px,-240px) scale(3,3);
And this conversion is pretty close to your matrix. If you look closer, you will see that the result of your matrix does not quite match your conversion result.
By the way, matrix multiplication exhibits the same behavior. The order in which you multiply the two matrices is important. To simplify the task, the order in which you set the transforms to CSS transform is the same in which matrix multiplication works. So
transform: translate(x, y) scale(fz, fy)
gives the same result as
transform: matrix (....)
where the matrix is โโcalculated as the matrix equivalent of the translation multiplied by the matrix equivalent of the scale.
source share