# How to fit a 3-D parametric equation to datapoints

Consider that I have $3$ parametric equations as function of time and describe the motion of a body in space:

$x = f(t)$

$y = g(t)$

$z = h(t)$

These curves are pretty simple and can be modeled within a certain interval by a 2nd order polynomial.

Is it as simple as performing individual fitting on each function or that would break the time relationship between the functions?

Any pointers appreciated.

-
You have values of $t$ apart from the Cartesian triples? It wouldn't be wrong to do three curve fits on each component, with the parameter as the independent variable and each of the components as dependent variables. –  Ｊ. Ｍ. Oct 17 '10 at 14:37
@J. M. Actually, questions like this are best addressed by considering the structure of the errors. If there is significant correlation, then independent curve fits might be inappropriate, depending on what is needed. As an example, the data might be GPS coordinates of a flight path and you might want the resulting fit to have no cusps or areas of unrealistically high curvature, a criterion that clearly involves interactions among all three coordinates. –  whuber Oct 17 '10 at 14:50
@whuber: Hmm, I hadn't taken correlation and/r errors in the coordinates into account; indeed my suggestion can result in something kinky if the configuration of the points is perverse enough. The problem now of course is much harder to solve. –  Ｊ. Ｍ. Oct 17 '10 at 15:04
@J. M.: Exactly right. To make progress we need to elicit more information from the OP. Specifically, what is the purpose of the fitting? What constraints might be implicit? What is known about the underlying path that we're trying to estimate? Are the data perfect or do they have measurement errors? How are the data collected (e.g., at regular time intervals, arbitrarily, or adapted to the curve)? –  whuber Oct 17 '10 at 15:39
The data is being collected from a pair or pictures at a certain fixed frame rate. The cameras (fix mounted) see a point in 2D space (u,v) and generate a 3D point for each frame. The problem is that these points can be somewhat noisy. Right now I'm working with the assumption that the particle moves with constant speed, but that might change after I start collecting more data. So what I'm doing is fitting x=f(t), y=g(t) and z=h(t) equations to obtain a more stable line through space. –  Padu Merloti Oct 18 '10 at 23:16