Creating a parametric equation given n points on a curve

483 Views Asked by At

I am doing a school project. I am having trouble figuring out where to start with this. Say I have an image like this camel and want to create a parametric equation of the curve. I assume I start with a number n equally spaced points on the curve. What is the best way to extract equally spaced points on the line? How, knowing n points on the line, can a parametric equation be created?

1

There are 1 best solutions below

0
On

For this kind of problems, I think that a possible idea is to use parametric cubic splines.

Let us start with the fact that you collected coordinates $(x_i,y_i)$ for as $n$ points on the original figure. Now, compute the value of the corresponding $d_i$ just as $$ d_{i+1}=d_i+\sqrt{(x_{i+1}-x_i)^2+(y_{i+1}-y_i)^2} \qquad (i=1,\cdots,n-1)$$ with $d_1=0$.

Doing so, you have, for each data point $i$, $(x_i,y_i,d_i)$. Now, build two cubic splines, one for $x=f(d)$ and another for $y=g(d)$, $d$ varying from $0$ to $d_n$.

Now, for any arbitrary value of parameter $d$, you can compute the corresponding $x$ and $y$ and get a smooth description of the whole curve.

It is sure that you can refine the process if you did not use a sufficient number of data points. So, using the first splines, you can generate more $(x,y)$ points and repeat the process untill the $d_i$'s do not change too much anymore.