Consider the equation
$$ x^2 + y^2 - R^2 = 0 \tag{1}\label{470162_1} $$
which describes a circle. For a given point (e.g. $P_1 = (0.8, 1.5)$) the parameter $R$ can be easily determined.
I am interested in the situation where I have $n$ distinct given points in the plane. I want to "fit" a closed algebraic curve given by $F_{\mathbf q}(x, y)=0$ through these points, where $F_{\mathbf q}(x, y)$ is a bivariate polynomial of order $N$ parameterized by the coefficient vector $\mathbf q$.
I suppose for $N>2$ this is hard or even impossible to solve analytically but a numerical approach would be sufficient for me.
$N$ can be choosen arbitrarily. In general $\mathbf q$ contains $(N + 2)(N+1)/2$ free parameters and the $n$ given points together pose $2n$ conditions. Thus I would suppose that $(N + 2)(N+1)/2 \geq 2n$ is a condition for solvability. But there might be additional constraints come into play to ensure that the curve is closed (may be better formulated: has at least one closed branch).
Question: Is there an established way to calculate $\mathbf q$ e.g. like reformulating the original problem (system of polynomial equations with the same structure) as a well posed optimization problem or cleverly using a Groebner Basis?