Example #1
0
        public void SimpleDualQuaternionTest2()
        {
            // Translation 5 units in X direction
            var translation = DualQuaternion.CreateTranslation(5, Vector3.UnitX);

            // Rotation of PI/2 around Z axis centered on origin - We are using Plücker coordinates to describe the axis of rotation
            var rotation = DualQuaternion.CreateRotationPlucker(Math.PI / 2f, Vector3.UnitZ, Vector3.Zero);

            // We compose displacements, translation is applied first
            var displacement = rotation * translation;

            // We apply the point transform (Clifford conjugation for points) on the origin point using the displacement
            var point = displacement.TransformPoint();

            // Assert
            Assert.That(point, Is.EqualTo(new Vector3(0, 5, 0)));
        }