public static Quaternion exp(Quaternion q, Quaternion store) {

        float len = FastMath.sqrt(q.x * q.x + q.y * q.y + q.z * q.z);
        float sinLen = FastMath.sin(len);
        float cosLen = FastMath.cos(len);

        store.w = cosLen;
        if (len > 0) {
            store.x = sinLen * q.x / len;
            store.y = sinLen * q.y / len;
            store.z = sinLen * q.z / len;
        } else {
            store.x = 0;
            store.y = 0;
            store.z = 0;
        }
        return store;
    }
Calculate the exponential of a pure quaternion.

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