This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import math | |
| from typing import Tuple, Dict | |
| def vector_to_length_angle(dx: float, dy: float) -> Tuple[float, float]: | |
| """ | |
| Convert a vector (dx, dy) to (length, angle_in_degrees). | |
| """ | |
| length = math.hypot(dx, dy) |