示例#1
0
 public void ClampToZero2()
 {
     VectorD zero = new VectorD(4);
       VectorD v = new VectorD(new[] { 0.1, 0.1, -0.1, 0.09 });
       v.ClampToZero(0.11);
       Assert.AreEqual(zero, v);
       v = new VectorD(new[] { 0.1, -0.11, 0.11, 0.0 });
       v.ClampToZero(0.1);
       Assert.AreNotEqual(zero, v);
 }
示例#2
0
 public void ClampToZero1()
 {
     VectorD zero = new VectorD(4);
       VectorD v = new VectorD(new[] { Numeric.EpsilonD / 2, Numeric.EpsilonD / 2, -Numeric.EpsilonD / 2, -Numeric.EpsilonD / 2 });
       v.ClampToZero();
       Assert.AreEqual(zero, v);
       v = new VectorD(new[] { -Numeric.EpsilonD * 2, Numeric.EpsilonD, Numeric.EpsilonD * 2, Numeric.EpsilonD });
       v.ClampToZero();
       Assert.AreNotEqual(zero, v);
 }