Calculates cubic hermite splines, coded to work in Unity using C#