Beispiel #1
0
    public void CreateScale()
    {
      Matrix33D i = Matrix33D.CreateScale(1.0);
      Assert.AreEqual(Matrix33D.Identity, i);

      Vector3D v = Vector3D.One;
      Matrix33D m = Matrix33D.CreateScale(2.0);
      Assert.AreEqual(2 * v, m * v);

      m = Matrix33D.CreateScale(-1.0, 1.5, 2.0);
      Assert.AreEqual(new Vector3D(-1.0, 1.5, 2.0), m * v);

      Vector3D scale = new Vector3D(-2.0, -3.0, -4.0);
      m = Matrix33D.CreateScale(scale);
      v = new Vector3D(1.0, 2.0, 3.0);
      Assert.AreEqual(v * scale, m * v);
    }