( a, b )
| 3599 | // Adapted from: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm |
| 3600 | |
| 3601 | function copySign( a, b ) { |
| 3602 | |
| 3603 | return b < 0 ? -Math.abs( a ) : Math.abs( a ); |
| 3604 | |
| 3605 | } |
| 3606 | |
| 3607 | var absQ = Math.pow( m.determinant(), 1.0 / 3.0 ); |
| 3608 | this.w = Math.sqrt( Math.max( 0, absQ + m.elements[0] + m.elements[5] + m.elements[10] ) ) / 2; |