Accord.Tests.Math.Matrix4x4Test.CreateFromYawPitchRollTest C# (CSharp) Method

CreateFromYawPitchRollTest() private method

private CreateFromYawPitchRollTest ( float yaw, float pitch, float roll ) : void
yaw float
pitch float
roll float
return void
        public void CreateFromYawPitchRollTest(float yaw, float pitch, float roll)
        {
            float radiansYaw = (float)(yaw * System.Math.PI / 180);
            float radiansPitch = (float)(pitch * System.Math.PI / 180);
            float radiansRoll = (float)(roll * System.Math.PI / 180);

            Matrix4x4 matrix = Matrix4x4.CreateFromYawPitchRoll(radiansYaw, radiansPitch, radiansRoll);

            Matrix4x4 xMatrix = Matrix4x4.CreateRotationX(radiansPitch);
            Matrix4x4 yMatrix = Matrix4x4.CreateRotationY(radiansYaw);
            Matrix4x4 zMatrix = Matrix4x4.CreateRotationZ(radiansRoll);

            Matrix4x4 rotationMatrix = (yMatrix * xMatrix) * zMatrix;

            CompareMatrixWithArray(matrix, rotationMatrix.ToArray());
        }