您需要定义要绘制的中间点.
然后您可以手动定义它们,也可以查看样条插值.
使用样条插值时,只需要一个中间点即可确定完整曲线.
在MATLAB中,你可以找到类似这样的演示spline2d.以下是它的要点:
% end points
X = [0 1];
Y = [0 0];
% intermediate point (you have to choose your own)
Xi = mean(X);
Yi = mean(Y) + 0.25;
Xa = [X(1) Xi X(2)];
Ya = [Y(1) Yi Y(2)];
t = 1:numel(Xa);
ts = linspace(min(t),max(t),numel(Xa)*10); % has to be a fine grid
xx = spline(t,Xa,ts);
yy = spline(t,Ya,ts);
plot(xx,yy); hold on; % curve
plot(X,Y,'or') % end points
plot(Xi,Yi,'xr') % intermediate point
在splined2中,它用于更大的点集,但没有中间点.如果您只是希望您的积分能够顺利连接,那么可能值得一看.