Mathematica Stack Exchange is a question and answer site for users of Mathematica. 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 sequence $\{(x_k, y_k, z_k)\}_{k=1}^n \subset \mathbb{R}^3$, all points along a path represented by the function $\gamma \colon \mathbb{R} \to \mathbb{R}^3$, which maps the distance along the path to a location in 3D space.

Is there any way for Mathematica to output an interpolation parametrized like $\gamma$, and has the sequence as a subset of its range?

share|improve this question
Related: Higher order periodic interpolation (curve fitting), although the question is slightly different. – Michael E2 Dec 26 '13 at 17:26
up vote 8 down vote accepted

You can do it with one Interpolation, if you specify the parameter values for each point. Below I made the interpolated points correspond to equally spaced values (Range[0, 1, 1/(Length[pts] - 1)]).

pts = Accumulate[RandomReal[{-1, 1}, {5, 3}]]
   {{0.634779, -0.777161, 0.579052},
    {0.0103853, -1.29444, -0.28947},
    {0.0948785, -1.83213, -0.497458},
    {0.495826, -2.40848, -0.000144566},
    {0.341527, -2.91349, 0.954199}}

ifn = Interpolation[
   Transpose[{N@Range[0, 1, 1/(Length[pts] - 1)], pts}]];

 ParametricPlot3D[ifn[t], {t, 0, 1}, PlotStyle -> Thick],
 Graphics3D[{Red, PointSize[Large], Point[pts]}]

Mathematica graphics

share|improve this answer
I guess we should get used to the new default color scheme ;) – shrx Dec 26 '13 at 17:29
A better approach would be to use centripetal or chord-length parametrization on the points, since they are based on the configuration of the points themselves, as opposed to uniformly spaced values. – J. M. Jul 25 '15 at 16:19

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.