public Quaternion mult(Quaternion q, Quaternion res) { if (res == null) res = new Quaternion();
public Quaternion mult(Quaternion q) { Quaternion res = new Quaternion();
    public Quaternion mult(Quaternion q, Quaternion res) {        if (res == null) res = new Quaternion();        res.x =  x * q.w + y * q.z - z * q.y + w * q.x;        res.y = -x * q.z + y * q.w + z * q.x + w * q.y;        res.z =  x * q.y - y * q.x + z * q.w + w * q.z;        res.w = -x * q.x - y * q.y - z * q.z + w * q.w;        return res;    }