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))
예제 #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
예제 #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
예제 #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)
     )
예제 #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	
예제 #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
예제 #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
예제 #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)
     )
예제 #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)
예제 #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))
예제 #12
0
파일: data.py 프로젝트: brianphan90/CPE101
 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))
예제 #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))
예제 #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))
예제 #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
예제 #16
0
파일: data.py 프로젝트: jonluu1/CPE-101
 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
예제 #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)
예제 #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					
예제 #19
0
 def __eq__(self, other):
     return self.center == other.center and utility.epsilon_equal(self.radius, other.radius)
예제 #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))
예제 #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))
예제 #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)
예제 #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))
예제 #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
예제 #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
예제 #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))
예제 #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))
예제 #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))
예제 #32
0
파일: data.py 프로젝트: blueostrich/cpe101
 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))
예제 #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))
예제 #36
0
 def __eq__(self, other):
     return (self.center == other.center) and epsilon_equal(self.radius, other.radius)
예제 #37
0
파일: data.py 프로젝트: brianphan90/CPE101
 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))
예제 #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))
예제 #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
예제 #41
0
파일: data.py 프로젝트: blueostrich/cpe101
 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)
예제 #42
0
 def test_epsilon_equal_3(self):
    self.assertFalse(utility.epsilon_equal(1.1, 1))
    self.assertFalse(utility.epsilon_equal(1, 1.1))
예제 #43
0
파일: data.py 프로젝트: blueostrich/cpe101
 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
예제 #44
0
 def test_epsilon_equal_4(self):
    self.assertTrue(utility.epsilon_equal(0.999999999, 1))
    self.assertTrue(utility.epsilon_equal(1, 0.999999999))
예제 #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)
예제 #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))
예제 #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)
예제 #48
0
 def test_epsilon_equal_1(self):
    self.assertTrue(utility.epsilon_equal(1, 1))
예제 #49
0
파일: data.py 프로젝트: jonluu1/CPE-101
 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
예제 #50
0
 def test_epsilon_equal_2(self):
    self.assertTrue(utility.epsilon_equal(1.00000000001, 1))
    self.assertTrue(utility.epsilon_equal(1, 1.00000000001))
예제 #51
0
파일: data.py 프로젝트: jonluu1/CPE-101
 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
예제 #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))
예제 #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)
     )
예제 #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))
예제 #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)
     )
예제 #56
0
파일: point.py 프로젝트: ggchan0/CPE-101
 def __eq__(self, other):
    result1 = utility.epsilon_equal(self.x, other.x)
    result2 = utility.epsilon_equal(self.y, other.y)
    return result1 and result2