2
$\begingroup$

Lets say I have a set of coordinates which when correctly (directly - a straight line) connected form a shape (a simple curve if you will). Think of star-shape, important is that a xalue x might have 1 or more corresponding y-values.

Task is to interpolate the given dataset with a cubic-spline interpolation.

Now with a for a a set of points where we have $\forall y_i : y_i \neq y_j $ this is trivial, I can just create my splines and be done with it.

How can I do this with the given points ?

If you need I can post the points in question.

Points are as follows (prepare to be spooked):

x | y
13.0 0.0
11.5 0.0
10.0 2.0
11.0 4.0
9.0 5.5
6.0 6.0
0.0 5.0
6.0 7.0
10.5 7.0
13.0 7.5
15.0 7.0
15.0 9.0
16.0 10.0
19.0 9.0
17.0 8.5
16.5 8.0
16.0 7.0
15.0 6.0
15.0 4.5
15.5 3.5
14.5 2.5
15.0 3.5
14.0 4.5
13.0 4.5
12.0 2.5
11.0 1.5
13.0 0.0
$\endgroup$
  • 2
    $\begingroup$ Make one spline for the function $i\rightarrow x_i$, and another for the function $i\rightarrow y_i$. You end up with a parametric curve, where both $x$ and $y$ are functions of a third variable. $\endgroup$ – Wouter Dec 4 '17 at 12:39
  • 2
    $\begingroup$ Represent the curve parametrically $t \mapsto (x(t), y(t))$ then one spline fit for each coordinate. If you post your points we can post examples. $\endgroup$ – kjetil b halvorsen Dec 4 '17 at 12:41
  • $\begingroup$ I've updated the post, how can I more learn about this topic so I can thouroughly understand the topic ? $\endgroup$ – zython Dec 4 '17 at 12:55
  • $\begingroup$ ok i have managed it on my own, as you said but it is unclear how this black magic works, how can I best understand this ? $\endgroup$ – zython Dec 4 '17 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.