Пример #1
0
 def testGetEndPointOnAngle(self):
     expectedPoint = {"x": 1, "y": 1}
     ray = Ray({"x": 0, "y": 0}, pi / 4, 2**0.5)
     assert Ray.pointsVeryClose(ray.getEndPoint(), expectedPoint)
Пример #2
0
 def testGetEndPointVerticalAngle(self):
     expectedPoint = {"x": 5, "y": 5}
     ray = Ray({"x": 5, "y": 0}, pi / 2, 5)
     assert Ray.pointsVeryClose(ray.getEndPoint(), expectedPoint)
Пример #3
0
 def testGetEndPointBackwards(self):
     expectedPoint = {"x": 1, "y": 1}
     ray = Ray({"x": 5, "y": 4}, atan(3 / 4) + pi, 5)
     assert Ray.pointsVeryClose(ray.getEndPoint(), expectedPoint)
Пример #4
0
 def testGetEndPointHorizontalAngle(self):
     expectedPoint = {"x": 5, "y": 5}
     ray = Ray({"x": 0, "y": 5}, 0, 5)
     assert Ray.pointsVeryClose(ray.getEndPoint(), expectedPoint)