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