Question: Help With Cubic Splines

so i  got this code:

But it cannot Find a value for M (wich would be the maximum distance between) it literaly stays working for severeal minutes and necer gives an answer, also i cant find a function to do this for every value for n (n-1 steps from a to b), also would mean that xy would need to get more points, any idea of how can i solve this for any n? or at least fix the problem with M, and i do the steps from a to b Manually.

heeeelp me please this is driving me nuts

thanks a lot :)

Please Wait...