<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_polar(image):
 """Transform image coordinates to polar. The image is transformed so that it is wrapped around a point in the centre. Vertical straight lines become circles or segments of circles, horizontal straight lines become radial spokes. """

    # xy image, origin in the centre, scaled to fit image to a circle
    xy = pyvips.Image.xyz(image.width, image.height)
    xy -= [image.width / 2.0, image.height / 2.0]
    scale = min(image.width, image.height) / float(image.width)
    xy *= 2.0 / scale

    index = xy.polar()

    # scale vertical axis to 360 degrees
    index *= [1, image.height / 360.0]

    return image.mapim(index)