Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of points in 3D which I need to fit a curve (not a plane) to. Essentially these points describe a string with a set order (i.e. point one connects to point two, etc.) and I need to fit a curve to follow these points and produce a smoothed, single-width string as a result.

Unfortunately all of the 3D fitting algorithms I've found so far (I'd probably go with polynomial fitting) result in a plane, not a line, and it's lead me to believe what I need is a 2D fitting algorithm which operates on three sets of coordinates.

I can work out how to do linear interpolation for these points, it's figuring out the polynomial that I'm struggling with. Does anybody have any helpful pointers for this?

share|cite|improve this question
up vote 1 down vote accepted

Since your points are already in a specified order, you could try fitting the $x$, $y$, and $z$ coordinates independently as functions of the index of the point in the ordering. That is, if you have points $(x_1,y_1,z_1)$, $(x_2,y_2,z_2)$, and so on, you fit $x_i$ as a function of $i$, then $y_i$ as a function of $i$, and $z_i$ as a function of $i$. Then your curve is given by $t\mapsto(x(t),y(t),z(t))$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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