public void TestEqualsEpsilon() { UnitCartesian first = new UnitCartesian(1.0, 1.0, 1.0); UnitCartesian second = new UnitCartesian(0.99, 1.0, 1.01); Assert.IsTrue(second.EqualsEpsilon(first, 1e-1)); Assert.IsTrue(second.EqualsEpsilon(first, 1e-2)); Assert.IsFalse(second.EqualsEpsilon(first, 1e-3)); Assert.IsFalse(second.EqualsEpsilon(first, 1e-4)); Assert.IsFalse(second.EqualsEpsilon(first, 1e-5)); }
public void TestEqualsEpsilonExact() { UnitCartesian first = new UnitCartesian(0.1, 0.1, 0.1); UnitCartesian second = new UnitCartesian(0.1, 0.1, 0.1); Assert.IsTrue(second.EqualsEpsilon(first, 0)); }
public void TestEqualsEpsilon() { UnitCartesian first = new UnitCartesian(1.0, 1.0, 1.0); UnitCartesian second = new UnitCartesian(0.99, 1.0, 1.01); Assert.IsTrue(second.EqualsEpsilon(first, 1e-1)); Assert.IsTrue(second.EqualsEpsilon(first, 1e-2)); Assert.IsFalse(second.EqualsEpsilon(first, 1e-3)); Assert.IsFalse(second.EqualsEpsilon(first, 1e-4)); Assert.IsFalse(second.EqualsEpsilon(first, 1e-5)); }