Exemplo n.º 1
0
        public void CreateScale()
        {
            Matrix22D i = Matrix22D.CreateScale(1.0);

            Assert.AreEqual(Matrix22D.Identity, i);

            Vector2D  v = Vector2D.One;
            Matrix22D m = Matrix22D.CreateScale(2.0);

            Assert.AreEqual(2 * v, m * v);

            m = Matrix22D.CreateScale(-1.0, 1.5);
            Assert.AreEqual(new Vector2D(-1.0, 1.5), m * v);

            Vector2D scale = new Vector2D(-2.0, -3.0);

            m = Matrix22D.CreateScale(scale);
            v = new Vector2D(1.0, 2.0);
            Assert.AreEqual(v * scale, m * v);
        }