qlerp method
Returns a lerped quaternion based on theta.
Implementation
Quaternion qlerp(Quaternion qa, Quaternion qb, double t2) {
Quaternion qm;
double t1 = 1.0 - t2;
qm = qa.scaled(t1) + qb.scaled(t2);
double len = sqrt(qm.x * qm.x + qm.y * qm.y + qm.z * qm.z + qm.w * qm.w);
qm.scale(1.0 - len);
return qm;
}