public float toAngleAxis(Vector3f axisStore) {
        float sqrLength = x * x + y * y + z * z;
        float angle;
        if (sqrLength == 0.0f) {
            angle = 0.0f;
            if (axisStore != null) {
                axisStore.x = 1.0f;
                axisStore.y = 0.0f;
                axisStore.z = 0.0f;
            }
        } else {
            angle = (2.0f * FastMath.acos(w));
            if (axisStore != null) {
                float invLength = (1.0f / FastMath.sqrt(sqrLength));
                axisStore.x = x * invLength;
                axisStore.y = y * invLength;
                axisStore.z = z * invLength;
            }
        }

        return angle;
    }
Converts the quaternion to a rotation angle and axis of rotation, storing
the axis in the argument (if it's non-null) and returning the angle.

<p>If the quaternion has {@code x*x + y*y + z*z == 0}, then (1,0,0) is
stored and 0 is returned. (This might happen if the rotation angle is
very close to 0.)

<p>Otherwise, the quaternion is assumed to be normalized (norm=1). No
error checking is performed; the caller must ensure that the quaternion
is normalized.

<p>In all cases, the current instance is unaffected.

@param axisStore storage for the axis (modified if not null)
@return the rotation angle (in radians)
jme3-core/src/main/java/com/jme3/math/Quaternion.java