예제 #1
0
        public ChQuaternion GetInverse()
        {
            ChQuaternion invq = this.GetConjugate();

            // dynamic l = this.Length();
            invq.Scale(1 / this.Length());
            return(invq);
        }
예제 #2
0
        // 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);
        }