public Vector3f getAxesAnglesRad ( ) { final double roll ; final double pitch ; double yaw ; final double test = w * x - y * z ; if ( Math . abs ( test ) < 0.4999 ) { roll = TrigMath . atan2 ( 2 * ( w * z + x * y ) , 1 - 2 * ( x * x + z * z ) ) ; pitch = TrigMath . asin ( 2 * test ) ; yaw = TrigMath . atan2 ( 2 * ( w * y + z * x ) , 1 - 2 * ( x * x + y * y ) ) ; } else { final int sign = ( test < 0 ) ? - 1 : 1 ; roll = 0 ; pitch = sign * Math . PI / 2 ; yaw = - sign * 2 * TrigMath . atan2 ( z , w ) ; } return new Vector3f ( pitch , yaw , roll ) ; }
Returns the angles in radians around the x y and z axes that correspond to the rotation represented by this quaternion .