背景
函数实现
function [P, U] = approximate_points(Q, p, alpha, TOL)
% INPUT
% Q - data points, [dim, n_points]
% p - degree of spline
% alpha - parametrization strategy, 1.0-chord-lengt, 0.5-centripetal
% TOL - tolerance of curve approximation
%
% OUTPUT
% P - control points of spline curve
% U - knot-vector of spline curve
if ~ismatrix(Q)
fprintf('the Input Q must be matrix \n');
return
end
[P, U] = approximate_points_impl(Q, p, alpha, TOL);
end
实例展示
视频展示
密集有序数据点的B样条曲线逼近(误差可控)-MATLAB