Hi. Imagine that a user draws on the canvas any path. I want to approximate this path with a path $P(x,y)=0$ where $P(x,y)$ - is unknown polynom. May be somebody can suggest an appropriate algorithm?
1) I tried to use the method of least squares to find this polynom. Just choosed on the path a lot of points $(x_i,y_i)$ . And minimized unknown $\sum\limits_i P(x_i,y_i)^2$ among all polinoms of degree n. This problem of minimization is a problem of finding an eigen vector of huge matrix that grows as $n^2\times n^2$. Already for $n=7$ this matrix has a size $36\times36$ it's hard work for PC to find the solution. And for $n=7$ it doesn't give appropriate result.
2) Spline doesn't work for me. Because spline - is a union of curves $P_i(x,y)=0$. To each spline of course we can correspond $P(x,y)=\prod\limits_i P_i(x,y) $. But this union $P(x,y)=0$ will have a lot of bifurcation points on the curve. And for my project it is very bad