Ejemplo n.º 1
0
 def test_almost_equals_2(self):
     EPSILON = 1e-10
     E = EPSILON * 0.5
     t = Affine(1.0, E, 0, -E, 1.0 + E, E)
     assert t.almost_equals(Affine.identity(), precision=EPSILON)
     assert Affine.identity().almost_equals(t, precision=EPSILON)
     assert t.almost_equals(t, precision=EPSILON)
     t = Affine(1.0, 0, 0, -EPSILON, 1.0, 0)
     assert not t.almost_equals(Affine.identity(), precision=EPSILON)
     assert not Affine.identity().almost_equals(t, precision=EPSILON)
     assert t.almost_equals(t, precision=EPSILON)
Ejemplo n.º 2
0
 def test_almost_equals(self):
     EPSILON = 1e-5
     E = EPSILON * 0.5
     t = Affine(1.0, E, 0, -E, 1.0 + E, E)
     assert t.almost_equals(Affine.identity())
     assert Affine.identity().almost_equals(t)
     assert t.almost_equals(t)
     t = Affine(1.0, 0, 0, -EPSILON, 1.0, 0)
     assert not t.almost_equals(Affine.identity())
     assert not Affine.identity().almost_equals(t)
     assert t.almost_equals(t)
Ejemplo n.º 3
0
 def test_almost_equals_2(self):
     EPSILON = 1e-10
     E = EPSILON * 0.5
     t = Affine(1.0, E, 0, -E, 1.0 + E, E)
     assert t.almost_equals(Affine.identity(), precision=EPSILON)
     assert Affine.identity().almost_equals(t, precision=EPSILON)
     assert t.almost_equals(t, precision=EPSILON)
     t = Affine(1.0, 0, 0, -EPSILON, 1.0, 0)
     assert not t.almost_equals(Affine.identity(), precision=EPSILON)
     assert not Affine.identity().almost_equals(t, precision=EPSILON)
     assert t.almost_equals(t, precision=EPSILON)
Ejemplo n.º 4
0
 def test_almost_equals(self):
     EPSILON = 1e-5
     E = EPSILON * 0.5
     t = Affine(1.0, E, 0, -E, 1.0 + E, E)
     assert t.almost_equals(Affine.identity())
     assert Affine.identity().almost_equals(t)
     assert t.almost_equals(t)
     t = Affine(1.0, 0, 0, -EPSILON, 1.0, 0)
     assert not t.almost_equals(Affine.identity())
     assert not Affine.identity().almost_equals(t)
     assert t.almost_equals(t)
Ejemplo n.º 5
0
 def test_almost_equals(self):
     from affine import EPSILON
     assert EPSILON != 0, EPSILON
     E = EPSILON * 0.5
     t = Affine(1.0, E, 0, -E, 1.0 + E, E)
     assert t.almost_equals(Affine.identity())
     assert Affine.identity().almost_equals(t)
     assert t.almost_equals(t)
     t = Affine(1.0, 0, 0, -EPSILON, 1.0, 0)
     assert not t.almost_equals(Affine.identity())
     assert not Affine.identity().almost_equals(t)
     assert t.almost_equals(t)