Esempio n. 1
0
        public void M34d_Multiply_M44d()
        {
            var mat   = M44d.RotationZ(1);
            var local = arr34;

            for (int i = 0; i < local.Length; i++)
            {
                local[i] = local[i] * mat;
            }
        }
Esempio n. 2
0
        public void M44d_Multiply()
        {
            var mat   = M44d.RotationZ(1);
            var local = arr44;

            for (int i = 0; i < local.Length; i++)
            {
                arr44[i] = mat * local[i];
            }
        }
Esempio n. 3
0
        public static void YawPitchRoll()
        {
            TrafoTesting.GenericTest(rnd =>
            {
                var yaw   = rnd.UniformDouble() * Constant.PiTimesFour - Constant.PiTimesTwo;
                var pitch = rnd.UniformDouble() * Constant.PiTimesFour - Constant.PiTimesTwo;
                var roll  = rnd.UniformDouble() * Constant.PiTimesFour - Constant.PiTimesTwo;

                // Aardvark euler angles: roll (X), pitch (Y), yaw (Z). Ther are applied in reversed order.
                var mat  = (M33d)(M44d.RotationZ(yaw) * M44d.RotationY(pitch) * M44d.RotationX(roll));
                var mat2 = (M33d)M44d.RotationEuler(roll, pitch, yaw);
                var mat3 = (M33d)(Rot3d.RotationZ(yaw) * Rot3d.RotationY(pitch) * Rot3d.RotationX(roll));
                var mat4 = (M33d)Rot3d.RotationEuler(roll, pitch, yaw);

                Assert.IsTrue(Fun.ApproximateEquals(mat, mat2, 1e-7));
                Assert.IsTrue(Fun.ApproximateEquals(mat, mat3, 1e-7));
                Assert.IsTrue(Fun.ApproximateEquals(mat, mat4, 1e-7));
            });
        }