def test_point_two(self):
        pt = point.Point(-4.7, 19.2)
        self.assertAlmostEqual(pt.x, -4.7)
        self.assertTrue(utility.epsilon_equal(pt.x, -4.7))

        self.assertAlmostEqual(pt.y, 19.2)
        self.assertTrue(utility.epsilon_equal(pt.y, 19.2))
Exemplo n.º 2
0
	def __eq__(self,other):
		if (utility.epsilon_equal(self.x,other.x)
		& utility.epsilon_equal(self.y,other.y)
		& utility.epsilon_equal(self.z,other.z)):
			return True
		else :
			return False
Exemplo n.º 3
0
 def __eq__(self, other):
     if utility.epsilon_equal(
             self.x, other.x, epsilon=0.00001) and utility.epsilon_equal(
                 self.y, other.y,
                 epsilon=0.00001) and utility.epsilon_equal(
                     self.z, other.z, epsilon=0.00001):
         return True
Exemplo n.º 4
0
 def __eq__(self, other):
     return (
         utility.epsilon_equal(self.ambient, other.ambient)
         and utility.epsilon_equal(self.diffuse, other.diffuse)
         and utility.epsilon_equal(self.specular, other.specular)
         and utility.epsilon_equal(self.roughness, other.roughness)
     )
Exemplo n.º 5
0
	def __eq__(self, other):
		if (utility.epsilon_equal(self.r,other.r)
		& utility.epsilon_equal(self.g,other.g)
		& utility.epsilon_equal(self.b,other.b)):
			return True
		else :
			return False	
Exemplo n.º 6
0
	def __eq__(self, other):
		if (utility.epsilon_equal(self.ambient,other.ambient)
		& utility.epsilon_equal(self.diffuse,other.diffuse)
		& utility.epsilon_equal(self.specular,other.specular)
		& utility.epsilon_equal(self.roughness,other.roughness)):
			return True
		else :
			return False
Exemplo n.º 7
0
 def __eq__(self, other):
     center = utility.epsilon_equal(self.center,
                                    other.center,
                                    epsilon=0.00001)
     radius = utility.epsilon_equal(self.radius,
                                    other.radius,
                                    epsilon=0.00001)
     color = utility.epsilon_equal(self.color, other.color, epsilon=0.00001)
     finish = utility.epsilon_equal(self.finish,
                                    other.finish,
                                    epsilon=0.00001)
     return center and radius and color and finish
Exemplo n.º 8
0
 def __eq__(self, other):
     ambient = utility.epsilon_equal(self.ambient,
                                     other.ambient,
                                     epsilon=0.00001)
     diffuse = utility.epsilon_equal(self.diffuse,
                                     other.diffuse,
                                     epsilon=0.00001)
     specular = utility.epsilon_equal(self.specular,
                                      other.specular,
                                      epsilon=0.00001)
     roughness = utility.epsilon_equal(self.roughness,
                                       other.roughness,
                                       epsilon=0.00001)
     return ambient and diffuse and specular and roughness
 def __eq__(self, other):
     return (
         (self.center == other.center)
         and (self.color == other.color)
         and (self.finish == other.finish)
         and utility.epsilon_equal(self.radius, other.radius)
     )
Exemplo n.º 10
0
 def __eq__(self, other):
     return utility.epsilon_equal(
         self.center.x, other.center.x) and utility.epsilon_equal(
             self.center.y, other.center.y) and utility.epsilon_equal(
                 self.center.z, other.center.z) and utility.epsilon_equal(
                     self.radius, other.radius) and utility.epsilon_equal(
                         self.color.r,
                         other.color.r) and utility.epsilon_equal(
                             self.color.g,
                             other.color.g) and utility.epsilon_equal(
                                 self.color.b,
                                 other.color.b) and utility.epsilon_equal(
                                     self.finish.ambient,
                                     other.finish.ambient)
Exemplo n.º 11
0
 def __eq__(self, other):
    return (epsilon_equal(self.min_x, other.min_x)
        and epsilon_equal(self.max_x, other.max_x)
        and epsilon_equal(self.min_y, other.min_y)
        and epsilon_equal(self.max_y, other.max_y)
        and epsilon_equal(self.width, other.width)
        and epsilon_equal(self.height, other.height))
Exemplo n.º 12
0
 def __eq__(self, other):
     return (utility.epsilon_equal(self.pt.x, other.py.y)
             and utility.epsilon_equal(self.pt.y, other.pt.y)
             and utility.epsilon_equal(self.pt.z, other.pt.z)
             and utility.epsilon_equal(self.dir.x, other.dir.x)
             and utility.epsilon_equal(self.dir.y, other.dir.y)
             and utility.epsilon_equal(self.dir.z, other.dir.z))
Exemplo n.º 13
0
 def __eq__(self, other):
    return (epsilon_equal(self.pt.x, other.pt.x)
        and epsilon_equal(self.pt.y, other.pt.y)
        and epsilon_equal(self.pt.z, other.pt.z)
        and epsilon_equal(self.color.r, other.color.r)
        and epsilon_equal(self.color.g, other.color.g)
        and epsilon_equal(self.color.b, other.color.b))
Exemplo n.º 14
0
   def __eq__(self, other):
      return (epsilon_equal(self.pt.x, other.pt.x) 
		  and epsilon_equal(self.pt.y, other.pt.y) 
		  and epsilon_equal(self.pt.z, other.pt.z) 
		  and epsilon_equal(self.dir.x, other.dir.x) 
		  and epsilon_equal(self.dir.y, other.dir.y) 
		  and epsilon_equal(self.dir.z, other.dir.z))
Exemplo n.º 15
0
	def __eq__(self, other):
		if (utility.epsilon_equal(self.center.x,other.center.x)
		& utility.epsilon_equal(self.center.y,other.center.y)
		& utility.epsilon_equal(self.center.z,other.center.z)
		& utility.epsilon_equal(self.radius,other.radius)
		& utility.epsilon_equal(self.color,other.color)
		& utility.epsilon_equal(self.finish.ambient,other.finish.ambient)
		& utility.epsilon_equal(self.finish.diffuse,other.finish.diffuse)):
			return True
		else :
			return False
Exemplo n.º 16
0
 def __eq__(self, other):
     equality1 = utility.epsilon_equal(self.pt.x, other.pt.x)
     equality2 = utility.epsilon_equal(self.pt.y, other.pt.y)
     equality3 = utility.epsilon_equal(self.pt.z, other.pt.z)
     equality4 = utility.epsilon_equal(self.dir.x, other.dir.x)
     equality5 = utility.epsilon_equal(self.dir.y, other.dir.y)
     equality6 = utility.epsilon_equal(self.dir.z, other.dir.z)
     return equality1 and equality2 and equality3 and equality4 and equality5 and equality6
Exemplo n.º 17
0
 def __eq__(self, other):
     return utility.epsilon_equal(
         self.point.x, other.point.x) and utility.epsilon_equal(
             self.point.y, other.point.y) and utility.epsilon_equal(
                 self.point.z, other.point.z) and utility.epsilon_equal(
                     self.color.r, other.color.r) and utility.epsilon_equal(
                         self.color.g,
                         other.color.g) and utility.epsilon_equal(
                             self.color.b, other.color.b)
Exemplo n.º 18
0
	def __eq__(self, other):
		if (utility.epsilon_equal(self.pt.x,other.pt.x)
		&	utility.epsilon_equal(self.pt.y,other.pt.y)
		&	utility.epsilon_equal(self.pt.z,other.pt.z)
		&	utility.epsilon_equal(self.color.r,other.color.r)
		&	utility.epsilon_equal(self.color.g,other.color.g)
		&	utility.epsilon_equal(self.color.b,other.color.b)):
			return True
		else :
			return False					
Exemplo n.º 19
0
 def __eq__(self, other):
     return self.center == other.center and utility.epsilon_equal(self.radius, other.radius)
Exemplo n.º 20
0
 def __eq__(self, other):
     return epsilon_equal(self.red, other.red) and epsilon_equal(self.green, other.green) and epsilon_equal(
         self.blue, other.blue)
Exemplo n.º 21
0
 def test_epsilon_equal_5(self):
     self.assertFalse(utility.epsilon_equal(0.999, 1))
     self.assertTrue(utility.epsilon_equal(0.999, 1, 0.01))
     self.assertFalse(utility.epsilon_equal(1, 0.999))
     self.assertTrue(utility.epsilon_equal(1, 0.999, 0.01))
Exemplo n.º 22
0
 def __eq__(self, other):
     return (epsilon_equal(self.x, other.x)
             and epsilon_equal(self.y, other.y)
             and epsilon_equal(self.z, other.z))
Exemplo n.º 23
0
 def __eq__(self, other):
     point = utility.epsilon_equal(self.pt, other.pt, epsilon=0.00001)
     color = utility.epsilon_equal(self.color, other.color, epsilon=0.00001)
Exemplo n.º 24
0
   def __eq__(self, other):
      return (epsilon_equal(self.center.x, other.center.x) 
          and epsilon_equal(self.center.y, other.center.y) 
          and epsilon_equal(self.center.z, other.center.z) 
          and epsilon_equal(self.radius, other.radius) 
          and epsilon_equal(self.color.r, other.color.r) 
          and epsilon_equal(self.color.g, other.color.g) 
          and epsilon_equal(self.color.b, other.color.b)
		  and epsilon_equal(self.finish.amb, other.finish.amb)
          and epsilon_equal(self.finish.diff, other.finish.diff)
          and epsilon_equal(self.finish.spec, other.finish.spec)
          and epsilon_equal(self.finish.rough, other.finish.rough))
Exemplo n.º 25
0
 def __eq__(self, other):
     check_center_x = epsilon_equal(self.center.x, other.center.x)
     check_center_y = epsilon_equal(self.center.y, other.center.y)
     check_radius = epsilon_equal(self.radius, other.radius)
     return check_center_x and check_center_y and check_radius
Exemplo n.º 26
0
 def __eq__(self, other):
     check_x = epsilon_equal(self.x, other.x)
     check_y = epsilon_equal(self.y, other.y)
     return check_x and check_y
Exemplo n.º 27
0
 def __eq__(self, other):
    return (epsilon_equal(self.amb, other.amb) 
        and epsilon_equal(self.diff, other.diff)
        and epsilon_equal(self.spec, other.spec)
        and epsilon_equal(self.rough, other.rough))
Exemplo n.º 28
0
 def test_epsilon_equal_3(self):
     self.assertFalse(utility.epsilon_equal(1.1, 1))
     self.assertFalse(utility.epsilon_equal(1, 1.1))
Exemplo n.º 29
0
 def __eq__(self, other):
     return (epsilon_equal(self.ambient, other.ambient) and \
     epsilon_equal(self.diffuse, other.diffuse) and epsilon_equal(\
     self.specular, other.specular) and epsilon_equal(self.roughness, \
     other.roughness))
Exemplo n.º 30
0
 def __eq__(self, other):
     return (utility.epsilon_equal(
         self.x, other.x)) and (utility.epsilon_equal(self.y, other.y))
Exemplo n.º 31
0
 def test_epsilon_equal_2(self):
     self.assertTrue(utility.epsilon_equal(1.00000000001, 1))
     self.assertTrue(utility.epsilon_equal(1, 1.00000000001))
Exemplo n.º 32
0
 def __eq__(self, other):
     return epsilon_equal(self.r, other.r) and \
            epsilon_equal(self.g, other.g) and \
            epsilon_equal(self.b, other.b)
Exemplo n.º 33
0
 def test_epsilon_equal_4(self):
     self.assertTrue(utility.epsilon_equal(0.999999999, 1))
     self.assertTrue(utility.epsilon_equal(1, 0.999999999))
Exemplo n.º 34
0
 def __eq__(self, other):
     return (self.center == other.center
             and utility.epsilon_equal(self.radius, other.radius))
Exemplo n.º 35
0
 def test_epsilon_equal_1(self):
     self.assertTrue(utility.epsilon_equal(1, 1))
Exemplo n.º 36
0
 def __eq__(self, other):
     return (self.center == other.center) and epsilon_equal(self.radius, other.radius)
Exemplo n.º 37
0
 def __eq__(self, other):
     return (utility.epsilon_equal(self.center.x, other.center.x)
             and utility.epsilon_equal(self.center.y, other.center.y)
             and utility.epsilon_equal(self.radius, other.radius))
Exemplo n.º 38
0
 def __eq__(self, other):
     return utility.epsilon_equal(
         self.ambient, other.ambient) and utility.epsilon_equal(
             self.diffuse, other.diffuse) and utility.epsilon_equal(
                 self.specular, other.specular) and utility.epsilon_equal(
                     self.roughness, other.roughness)
 def test_point_one(self):
     pt = point.Point(1, 2)
     self.assertAlmostEqual(pt.x, 1)
     self.assertAlmostEqual(pt.y, 2)
     self.assertTrue(utility.epsilon_equal(pt.x, 1))
     self.assertTrue(utility.epsilon_equal(pt.y, 2))
Exemplo n.º 40
0
 def __eq__(self, other):
     r = utility.epsilon_equal(self.r, other.r, epsilon=0.00001)
     g = utility.epsilon_equal(self.g, other.g, epsilon=0.00001)
     b = utility.epsilon_equal(self.b, other.b, epsilon=0.00001)
     return r and g and b
Exemplo n.º 41
0
 def __eq__(self, other):
     return epsilon_equal(self.x, other.x) and \
            epsilon_equal(self.y, other.y) and \
            epsilon_equal(self.z, other.z)
Exemplo n.º 42
0
 def test_epsilon_equal_3(self):
    self.assertFalse(utility.epsilon_equal(1.1, 1))
    self.assertFalse(utility.epsilon_equal(1, 1.1))
Exemplo n.º 43
0
 def __eq__(self, other):
     return epsilon_equal(self.radius, other.radius) and \
         self.center == other.center and \
         self.color == other.color and \
         self.finish == other.finish
Exemplo n.º 44
0
 def test_epsilon_equal_4(self):
    self.assertTrue(utility.epsilon_equal(0.999999999, 1))
    self.assertTrue(utility.epsilon_equal(1, 0.999999999))
Exemplo n.º 45
0
 def __eq__(self, other):
     return utility.epsilon_equal(
         self.r, other.r) and utility.epsilon_equal(
             self.g, other.g) and utility.epsilon_equal(self.b, other.b)
Exemplo n.º 46
0
 def test_epsilon_equal_5(self):
    self.assertFalse(utility.epsilon_equal(0.999, 1))
    self.assertTrue(utility.epsilon_equal(0.999, 1, 0.01))
    self.assertFalse(utility.epsilon_equal(1, 0.999))
    self.assertTrue(utility.epsilon_equal(1, 0.999, 0.01))
Exemplo n.º 47
0
 def __eq__(self, other):
     return utility.epsilon_equal(
         self.x, other.x) and utility.epsilon_equal(
             self.y, other.y) and utility.epsilon_equal(self.z, other.z)
Exemplo n.º 48
0
 def test_epsilon_equal_1(self):
    self.assertTrue(utility.epsilon_equal(1, 1))
Exemplo n.º 49
0
 def __eq__(self, other):
     equality1 = utility.epsilon_equal(self.x, other.x)
     equality2 = utility.epsilon_equal(self.y, other.y)
     equality3 = utility.epsilon_equal(self.z, other.z)
     return equality1 and equality2 and equality3
Exemplo n.º 50
0
 def test_epsilon_equal_2(self):
    self.assertTrue(utility.epsilon_equal(1.00000000001, 1))
    self.assertTrue(utility.epsilon_equal(1, 1.00000000001))
Exemplo n.º 51
0
 def __eq__(self, other):
     equality1 = utility.epsilon_equal(self.center.x, other.center.x)
     equality2 = utility.epsilon_equal(self.center.y, other.center.y)
     equality3 = utility.epsilon_equal(self.center.z, other.center.z)
     equality4 = utility.epsilon_equal(self.radius, other.radius)
     return equality1 and equality2 and equality3 and equality4
Exemplo n.º 52
0
 def __eq__(self, other):
     return (self.center == other.center and epsilon_equal(self.radius, \
     other.radius) and self.color == other.color and \
     epsilon_equal(self.ambient, other.ambient))
Exemplo n.º 53
0
 def __eq__(self, other):
     return (
         utility.epsilon_equal(self.r, other.r)
         and utility.epsilon_equal(self.g, other.g)
         and utility.epsilon_equal(self.b, other.b)
     )
Exemplo n.º 54
0
 def __eq__(self, other):
     return (epsilon_equal(self.r, other.r)
             and epsilon_equal(self.g, other.g)
             and epsilon_equal(self.b, other.b))
Exemplo n.º 55
0
 def __eq__(self, other):
     return (
         utility.epsilon_equal(self.x, other.x)
         and utility.epsilon_equal(self.y, other.y)
         and utility.epsilon_equal(self.z, other.z)
     )
Exemplo n.º 56
0
 def __eq__(self, other):
    result1 = utility.epsilon_equal(self.x, other.x)
    result2 = utility.epsilon_equal(self.y, other.y)
    return result1 and result2