flightPathRate = 1;
x = -5:flightPathRate:10;
y = sin(4*x);
z = linspace(3,5, length(x));
curve = cscvn(pathDataLocal(:,2:4)');
plot3(x, y, z, 'ob-')
hold on
fnplt(curve)
splinePoints = fnval(curve, 0:0.1:16);
plot3(splinePoints(1,:), splinePoints(2,:), splinePoints(3,:), '*')
cs = cat(1,0,cumsum(sqrt(sum(diff([x', y', z'], [], 1).^2, 2))));
dd = interp1(cs, [x', y', z'], unique([cs(:)' linspace(0,cs(end),100)]), 'spline');
plot3(dd(:,1), dd(:,2), dd(:,3), '.r-')
axis image, view(3), legend({'Original', 'Spline Curve with cscvn/fnplt', 'Interp. Points with cscvn/fnval', 'Interp. Spline with interp1'})
hold off
0 件のコメント
サインインしてコメントする。