function [rt,d] = rspl_val(r,t) % RSPL_VAL : evaluation of rational splines % [rt,d] = rspl_val(r,t) % points rt(j,:) and weight points $d(k,:)$ % for a rational spline r % with control points r.c(k,:), weights r.w(k), % and knots r.tau(k) at t(j) d = size(r.c,2); wd = repmat(r.w,1,d); s.c = [wd.*r.c r.w]; s.tau = r.tau; rt = spl_val(s,t); rt = rt(:,1:end-1)./repmat(rt(:,end),1,d); d = (wd(1:end-1,:).*r.c(1:end-1,:) + ... wd(2:end,:).*r.c(2:end,:)) ./ ... (wd(1:end-1,:) + wd(2:end,:));