/// Operator for quaternion product: A%B means the typical quaternion product AxB. public static ChQuaternion operator %(ChQuaternion q, ChQuaternion other) // works fine { ChQuaternion a = new ChQuaternion(1, 0, 0, 0); // QUNIT; a.Cross(q, other); return(a); }
public static ChQuaternion operator *(ChQuaternion a, ChQuaternion other) { ChQuaternion q = new ChQuaternion(1, 0, 0, 0);//QUNIT; q.Cross(a, other); return(q); }
// Get the quaternion first derivative from the vector of angular acceleration with a specified in _absolute_ coords. public void Qdtdt_from_Aabs2(ChVector a, ChQuaternion q, ChQuaternion q_dt) { ChQuaternion qao = new ChQuaternion(0, a); ChQuaternion qwo = new ChQuaternion(1, 0, 0, 0); //QNULL; ChQuaternion qtmpa = new ChQuaternion(1, 0, 0, 0); ChQuaternion qtmpb = new ChQuaternion(1, 0, 0, 0); //QNULL; qwo.Cross(q_dt, q.GetConjugate()); qtmpb.Cross(qwo, q_dt); qtmpa.Cross(qao, q); qtmpa.Scale(0.5); this.Add(qtmpa, qtmpb); }