def polar2cart(r, theta, center):
    x = r * np.cos(theta) + center[0]
y = r * np.sin(theta) + center[1]
return x, y

def img2polar(img, center, final_radius, initial_radius=None, phase_width=3000
    ):
    if initial_radius is None:
        initial_radius = 0
theta, R = np.meshgrid(np.linspace(0, 2 * np.pi, phase_width), np.arange(
    initial_radius, final_radius))
Xcart, Ycart = polar2cart(R, theta, center)
Xcart = Xcart.astype(int)
быстрый декартовский в полярный в декартовый в Python