small spline library adopted from Tino Kluge