def project(solution: Point2) -> float: angle = math.radians(utils.point_angle(solution) - direction_angle) return solution.magnitude() * math.cos(angle)
def point_angle(a: Point2): angle = math.degrees(math.acos(a.x / a.magnitude())) if a.y < 0: angle = -angle return angle