Perfect ! Thanks a lot for your help.
I have indeed make a mistake on the definition of n which is defined as a function in the book and wasn't defined like this in my code.
I have corrected by using unapply function.
Now, i do obtain the same results than in the book.
I attach here the last version of my code:
However, there are some lines that I didn't understand which are :
Normally, I guess these lines enable the definition of the curve with the Catmull-Rom splines. But, I didn't understand the operation of it namely the 2 following points :
- why it used the index (t-i+1) in the defintion of pp ?
- how the return function works? I have seen the help, but i didn't seen any examples which makes me difficult to understand for me.
Otherwise, the definition of the polynomial curve defined with Catmull-Rom splines which I would like to implement works normally like this :
You takes 4 points (M1M2M3M4). The polynomial curve obtained with the Catmull-Rom splines is a curve between the point M2 and M3 (match with M2 and M3.
Next, you takes 4 others points (M2M3M4M5). The polynomial curve obtained with the Catmull-Rom splines is a curve between the point M3 and M4 and so on.
Here a picture to illustrate how the Cadmull-Rom splines works:
I think that the use of the function "piecewise" should be adapted to the definition of this polynomial curve with Catmull-rom splines.
May you help me to implement this polynomial curve with a piecewise function in Maple ?
This way can be more easy to understand (because simpler) than the solution proposed in this book.
Thanks a lot for your help