public static void transform() { // test math to rotate normal to normal var from = new Vector3d(0, -1, 0); var to = new Vector3d(0, 0, 1); var q = new Quaterniond(from, to); // direct transform var test = new Vector3d(1, 0, 1); // test vector var transformed = q * test; var q1 = q.Inverse(); var reTransformed = q1 * transformed; }
public void Inverse() { for (int i = 0; i < count; i++) { Quaternion a = new Quaternion(); Quaterniond ad = new Quaterniond(); RandomQuaternion(ref a, ref ad); Quaternion value = Quaternion.Inverse(a); Quaterniond valued = Quaterniond.Inverse(ad); Assert.True(Approximate(value, valued)); } }