コード例 #1
0
    public void ClampToZero()
    {
      Matrix33D m = new Matrix33D(0.0000000000001);
      m.ClampToZero();
      Assert.AreEqual(new Matrix33D(), m);

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

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

      m = new Matrix33D(0.1);
      m.ClampToZero(0.01);
      Assert.AreEqual(new Matrix33D(0.1), m);
    }
コード例 #2
0
    public void ClampToZeroStatic()
    {
      Matrix33D m = new Matrix33D(0.0000000000001);
      Assert.AreEqual(new Matrix33D(), Matrix33D.ClampToZero(m));
      Assert.AreEqual(new Matrix33D(0.0000000000001), m); // m unchanged?

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

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

      m = new Matrix33D(0.1);
      Assert.AreEqual(new Matrix33D(0.1), Matrix33D.ClampToZero(m, 0.01));
      Assert.AreEqual(new Matrix33D(0.1), m);
    }
コード例 #3
0
ファイル: Matrix33DTest.cs プロジェクト: Zolniu/DigitalRune
        public void ClampToZero()
        {
            Matrix33D m = new Matrix33D(0.0000000000001);
              m.ClampToZero();
              Assert.AreEqual(new Matrix33D(), m);

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

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

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