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