The one-dimensional 4 Γ 4 transformation matrix is ββdefined as follows:
| x2 | | R11*SX R12*SY R13*SZ TX | | x1 | | y2 | = | R21*SX R22*SY R23*SZ TY | | y1 | | z2 | | R31*SX R32*SY R33*SZ TZ | | z1 | | 1 | | 0 0 0 1 | | 1 |
where (SX,SY,SZ)
are the scaling factors, (TX,TY,TZ)
are the translation coefficients, and Rij
are the rotation coefficients.
Getting the translation is trivial since you select the last column. To get the scaling, you use the property that the transformation is the rotation time of the diagonal scaling ( A=R*S
) and, therefore,
tr(A)*A = tr(R*S)*(R*S) = tr(S)*tr(R)*R*S = tr(S)*S
where tr(A)
is the transpose operator. To calculate scaling factors
S2 = tr(A)*A
and select the square root of the first three diagonal terms
SX = sqrt(S2(1,1)) SY = sqrt(S2(2,2)) SZ = sqrt(S2(3,3))
Then create a new transformation as:
| SX 0 0 TX | | 0 SY 0 TY | | 0 0 SZ TZ | | 0 0 0 1 |
source share