def polar2d(vx, vy, deg=True): "2D Cartesian to Polar conversion" a = atan2(vy, vx) return hypot(vx, vy), (a / DEG if deg else a)