Converting Cartesian curves to polar form