Spline Interpolation

Hi everyone!
I have the following problem when evaluating a spline. I have points with a ‘high’ value of longitude (175), and very ‘low’ (-175), so when evaluating a spline with points of this sort as beginning and ending of the spline, it goes all the way around the globe!

When seeing the picture, it seems obvious that the path between points like this should go through the international date line (or where X values end).

How can I achieve this?

Thanks!

Hey Juan,

This is a classic problem of finding the shortest angle between two angles. Check out the solution here:

Let me know if that works!