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)
def testGetEndPointVerticalAngle(self): expectedPoint = {"x": 5, "y": 5} ray = Ray({"x": 5, "y": 0}, pi / 2, 5) assert Ray.pointsVeryClose(ray.getEndPoint(), expectedPoint)
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)
def testGetEndPointHorizontalAngle(self): expectedPoint = {"x": 5, "y": 5} ray = Ray({"x": 0, "y": 5}, 0, 5) assert Ray.pointsVeryClose(ray.getEndPoint(), expectedPoint)