コード例 #1
0
    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
ファイル: data.py プロジェクト: mattpiasecki/RayCaster
	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
ファイル: data.py プロジェクト: jacrocitto/RayCaster
 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
ファイル: data.py プロジェクト: mattpiasecki/RayCaster
	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
ファイル: data.py プロジェクト: mattpiasecki/RayCaster
	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
コード例 #9
0
 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
ファイル: data.py プロジェクト: devinnicholson/Raycaster
 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
ファイル: data.py プロジェクト: 14bmkelley/raytracer-python
 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
ファイル: data.py プロジェクト: 14bmkelley/raytracer-python
 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
ファイル: data.py プロジェクト: 14bmkelley/raytracer-python
   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
ファイル: data.py プロジェクト: mattpiasecki/RayCaster
	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
ファイル: data.py プロジェクト: devinnicholson/Raycaster
 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
ファイル: data.py プロジェクト: mattpiasecki/RayCaster
	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
ファイル: data.py プロジェクト: jacrocitto/RayCaster
 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)
コード例 #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))
コード例 #22
0
ファイル: data.py プロジェクト: bertair7/schoolprojects
 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
ファイル: data.py プロジェクト: 14bmkelley/raytracer-python
   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
ファイル: data.py プロジェクト: 14bmkelley/raytracer-python
 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))
コード例 #28
0
 def test_epsilon_equal_3(self):
     self.assertFalse(utility.epsilon_equal(1.1, 1))
     self.assertFalse(utility.epsilon_equal(1, 1.1))
コード例 #29
0
ファイル: data.py プロジェクト: bertair7/schoolprojects
 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))
コード例 #31
0
 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)
コード例 #33
0
 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))
コード例 #35
0
 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
ファイル: data.py プロジェクト: devinnicholson/Raycaster
 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)
コード例 #39
0
 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
ファイル: utility_tests.py プロジェクト: crazymach/cpe101
 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
ファイル: utility_tests.py プロジェクト: crazymach/cpe101
 def test_epsilon_equal_4(self):
    self.assertTrue(utility.epsilon_equal(0.999999999, 1))
    self.assertTrue(utility.epsilon_equal(1, 0.999999999))
コード例 #45
0
ファイル: data.py プロジェクト: devinnicholson/Raycaster
 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
ファイル: utility_tests.py プロジェクト: crazymach/cpe101
 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
ファイル: data.py プロジェクト: devinnicholson/Raycaster
 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
ファイル: utility_tests.py プロジェクト: crazymach/cpe101
 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
ファイル: utility_tests.py プロジェクト: crazymach/cpe101
 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
ファイル: data.py プロジェクト: bertair7/schoolprojects
 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
ファイル: data.py プロジェクト: jacrocitto/RayCaster
 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
ファイル: data.py プロジェクト: bertair7/schoolprojects
 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
ファイル: data.py プロジェクト: jacrocitto/RayCaster
 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