Fitting cubic spline curve to 2d points