public void Vector2TransformNormal3x2Test() { Vector2 v = new Vector2(1.0f, 2.0f); Matrix3x2 m = Matrix3x2.CreateRotation(MathHelper.ToRadians(30.0f)); m.M31 = 10.0f; m.M32 = 20.0f; Vector2 expected = new Vector2(-0.133974612f, 2.232051f); Vector2 actual; actual = Vector2.TransformNormal(v, m); Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value."); }
public void Vector2TransformNormalTest() { Vector2 v = new Vector2(1.0f, 2.0f); Matrix4x4 m = Matrix4x4.CreateRotationX(MathHelper.ToRadians(30.0f)) * Matrix4x4.CreateRotationY(MathHelper.ToRadians(30.0f)) * Matrix4x4.CreateRotationZ(MathHelper.ToRadians(30.0f)); m.M41 = 10.0f; m.M42 = 20.0f; m.M43 = 30.0f; Vector2 expected = new Vector2(0.3169873f, 2.18301272f); Vector2 actual; actual = Vector2.TransformNormal(v, m); Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Tranform did not return the expected value."); }