Function that calculates curve points for cubic spline