public static Quaternion log(Quaternion q, Quaternion store) {
        float a = FastMath.acos(q.w);
        float sina = FastMath.sin(a);

        store.w = 0;
        if (sina > 0) {
            store.x = a * q.x / sina;
            store.y = a * q.y / sina;
            store.z = a * q.z / sina;
        } else {
            store.x = 0;
            store.y = 0;
            store.z = 0;
        }
        return store;
    }
Calculate the natural logarithm of a unit quaternion.

@param q the input Quaternion (not null, normalized, unaffected)
@param store storage for the result (not null, modified)
@return the logarithm (store)
jme3-core/src/main/java/com/jme3/math/MathUtils.java