Ejemplo n.º 1
0
        public void ClampToZero()
        {
            Matrix22F m = new Matrix22F(0.000001f);

            m.ClampToZero();
            Assert.AreEqual(new Matrix22F(), m);

            m = new Matrix22F(0.1f);
            m.ClampToZero();
            Assert.AreEqual(new Matrix22F(0.1f), m);

            m = new Matrix22F(0.001f);
            m.ClampToZero(0.01f);
            Assert.AreEqual(new Matrix22F(), m);

            m = new Matrix22F(0.1f);
            m.ClampToZero(0.01f);
            Assert.AreEqual(new Matrix22F(0.1f), m);
        }
Ejemplo n.º 2
0
        public void ClampToZeroStatic()
        {
            Matrix22F m = new Matrix22F(0.000001f);

            Assert.AreEqual(new Matrix22F(), Matrix22F.ClampToZero(m));
            Assert.AreEqual(new Matrix22F(0.000001f), m); // m unchanged?

            m = new Matrix22F(0.1f);
            Assert.AreEqual(new Matrix22F(0.1f), Matrix22F.ClampToZero(m));
            Assert.AreEqual(new Matrix22F(0.1f), m);

            m = new Matrix22F(0.001f);
            Assert.AreEqual(new Matrix22F(), Matrix22F.ClampToZero(m, 0.01f));
            Assert.AreEqual(new Matrix22F(0.001f), m);

            m = new Matrix22F(0.1f);
            Assert.AreEqual(new Matrix22F(0.1f), Matrix22F.ClampToZero(m, 0.01f));
            Assert.AreEqual(new Matrix22F(0.1f), m);
        }
Ejemplo n.º 3
0
        public void ClampToZero()
        {
            Matrix22F m = new Matrix22F(0.000001f);
              m.ClampToZero();
              Assert.AreEqual(new Matrix22F(), m);

              m = new Matrix22F(0.1f);
              m.ClampToZero();
              Assert.AreEqual(new Matrix22F(0.1f), m);

              m = new Matrix22F(0.001f);
              m.ClampToZero(0.01f);
              Assert.AreEqual(new Matrix22F(), m);

              m = new Matrix22F(0.1f);
              m.ClampToZero(0.01f);
              Assert.AreEqual(new Matrix22F(0.1f), m);
        }