Пример #1
0
        public void Conjugate()
        {
            Quaternion q = new Quaternion(1, 2, 3, 4);
            Quaternion expected = new Quaternion(-1, -2, -3, 4);
            Compare(expected, Quaternion.Conjugate(q));

            Quaternion result;
            Quaternion.Conjugate(ref q, out result);
            Compare(expected, result);

            q.Conjugate();
            Compare(expected, q);
        }
Пример #2
0
 public static Vector3 ForwardVector(this Quaternion q)
 {
     var temp = new Quaternion(q.X, q.Y, q.Z, q.W);
     temp.Conjugate();
     return Vector3.Transform(Vector3.Forward, temp);
 }