2
$\begingroup$

I have x,y coordinates. They are arranged at fixed intervals of 1 unit along the x axis. The Y values are arbitrary. I want to draw smooth curvy line that passes through all of them. Or rather, I want a formula to find the y for any value of x for the hypothetical line.

$\endgroup$
  • $\begingroup$ This asks for an interpolation of the $(x,y)$ coordinates "arranged at fixed intervals", or if you intend to "find the $y$ for any value of $x$" this would be extrapolation when $x$ falls outside the intervals of given coordinates. A good interpolation procedure is chosen based on what you plan to do with the curve; there is no single best procedure. $\endgroup$ – hardmath Mar 6 '16 at 15:10
2
$\begingroup$

Here are a few methods you can use:

  1. Simply interpolate them using a bunch of quadratics. The resulting curve will have discontinuous 2nd derivative.

  2. Lagrange polynomial

  3. Discrete Fourier transform

| cite | improve this answer | |
$\endgroup$
1
$\begingroup$

Cubic (or other degree) splines. That way you can make the curve as smooth as you want.

| cite | improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.