In Lagrangian Mechanics, we usually use generalized coordinates $q_i$ instead of the usual Cartesian coordinates $x_i$. Is there a systematic way to identify what the generalized coordinates are when given a problem with Cartesian coordinates and holonomic constraints?
For example, for a 2D particle moving on the perimeter of a circle with radius $r$ centered on the origin, we usually identify the polar angle $\theta$ as the generalized coordinate.
While in terms of Cartesian coordinates, we have the coordinates $x$ and $y$ and the holonomic constraint $x^2+y^2=r^2$ to describe the motion of the particle. How can we start from the Cartesian coordinates $x$, $y$ and the constraint $x^2+y^2=r^2$ to derive that the correct generalized coordinate to use is the polar angle $\theta$?