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))
Esempio 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
Esempio 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
Esempio 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)
     )
Esempio 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	
Esempio 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
Esempio 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
Esempio 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)
     )
Esempio 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)
Esempio 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))
Esempio 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))
Esempio 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))
Esempio 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))
Esempio 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
Esempio 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
Esempio 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)
Esempio 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					
Esempio n. 19
0
 def __eq__(self, other):
     return self.center == other.center and utility.epsilon_equal(self.radius, other.radius)
Esempio 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)
 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))
Esempio 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))
Esempio 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)
Esempio 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))
Esempio 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
Esempio 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
Esempio 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))
 def test_epsilon_equal_3(self):
     self.assertFalse(utility.epsilon_equal(1.1, 1))
     self.assertFalse(utility.epsilon_equal(1, 1.1))
Esempio 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))
Esempio n. 30
0
 def __eq__(self, other):
     return (utility.epsilon_equal(
         self.x, other.x)) and (utility.epsilon_equal(self.y, other.y))
 def test_epsilon_equal_2(self):
     self.assertTrue(utility.epsilon_equal(1.00000000001, 1))
     self.assertTrue(utility.epsilon_equal(1, 1.00000000001))
Esempio 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)
 def test_epsilon_equal_4(self):
     self.assertTrue(utility.epsilon_equal(0.999999999, 1))
     self.assertTrue(utility.epsilon_equal(1, 0.999999999))
Esempio n. 34
0
 def __eq__(self, other):
     return (self.center == other.center
             and utility.epsilon_equal(self.radius, other.radius))
 def test_epsilon_equal_1(self):
     self.assertTrue(utility.epsilon_equal(1, 1))
Esempio n. 36
0
 def __eq__(self, other):
     return (self.center == other.center) and epsilon_equal(self.radius, other.radius)
Esempio 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))
Esempio 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))
Esempio 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
Esempio 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)
Esempio 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))
Esempio 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
Esempio 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))
Esempio 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)
Esempio 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))
Esempio 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)
Esempio n. 48
0
 def test_epsilon_equal_1(self):
    self.assertTrue(utility.epsilon_equal(1, 1))
Esempio 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
Esempio 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))
Esempio 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
Esempio 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))
Esempio 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)
     )
Esempio 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))
Esempio 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)
     )
Esempio 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