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); }
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); }