I have created a B-spline using the following method:
cp_x=[0 11.19 28.26 59.12 88.99 90.82 100];cp_y=[0 9.90 23.58 27.65 75.90 85.22 100];knotVector = [0 0 0 0 0 0.3333 0.6667 1 1 1 1 1];cp=[cp_x(1),cp_x(2),cp_x(3),cp_x(4),cp_x(5),cp_x(6),cp_x(7);cp_y(1),cp_y(2),cp_y(3),cp_y(4),cp_y(5),cp_y(6),cp_y(7)];sp = spmak(knotVector,cp);points = fnplt(sp);
I now want to create a B-spline which matches the existing spline as closely as possible; however, I want to change the 'x' coordinates of the coefficients to:
cp_x=[0 10 25 50 75 90 100];
I now need to work out what values of "cp_y" will give me a b-spline closely resembling the original spline.
I had an idea (which definitely isn't the most efficient way of carrying out this task) of running a loop which iterates through various 'y' coordinates and creates a spline. I then find the max distance between the 2 splines and keep iterating through the 'y' coordinates until the maximum distance is minimised. I think this will be a very time consuming and process though.
Any help with finding a better solution would be greatly appreciated.
Best Answer