How to get scale vector from matrix?

How to get scale vector from matrix?
// |Sx 0 0 0|
// |0 Sy*cos(Θx) Sy*sin(Θx) 0|
// |0 -Sz*sin(Θx) Sz*cos(Θx) 0|
// |Tx Ty Tz 1|
// r0 r3 r6 t0
// r1 r4 r7 t1
// r2 r5 r8 t2
// 0 0 0 1
//XScale = sqrt(r0*r0+r3*r3+r6*r6);
//YScale = sqrt(r1*r1+r4*r4+r7*r7);
//ZScale = sqrt(r2*r2+r5*r5+r8*r8);
For 3ds Max Matrix3:
float ScaleX = currentTM.GetRow(0).Length();
float ScaleY = currentTM.GetRow(1).Length();
float ScaleZ = currentTM.GetRow(2).Length();

看完不过瘾?点此向作者提问