コード例 #1
0
        public void CreateRotation2()
        {
            double    angle = (double)MathHelper.ToRadians(30);
            Matrix22D m     = Matrix22D.CreateRotation(angle);

            Assert.IsTrue(Vector2D.AreNumericallyEqual(new Vector2D((double)Math.Cos(angle), (double)Math.Sin(angle)), m * Vector2D.UnitX));
        }
コード例 #2
0
        public void CreateRotation()
        {
            Matrix22D m = Matrix22D.CreateRotation(0.0);

            Assert.AreEqual(Matrix22D.Identity, m);

            m = Matrix22D.CreateRotation((double)Math.PI / 2);
            Assert.IsTrue(Vector2D.AreNumericallyEqual(Vector2D.UnitY, m * Vector2D.UnitX));
        }