nurbs曲线的matlab程序源码,附算例 - matlab算法设计 - 谷速源码
下载频道> 资源分类> matlab源码> 算法设计> nurbs曲线的matlab程序源码,附算例

标题:nurbs曲线的matlab程序源码,附算例
分享到:

所属分类: 算法设计 资源类型:程序源码 文件大小: 2.99 KB 上传时间: 2019-07-16 23:31:29 下载次数: 9 资源积分:1分 提 供 者: jiqiren nurbs曲线的matlab程序源码,附算例
内容:
function [N] = basisfunction(n, npts, u, t)
% Evaluate basis function at specified u.
%
% Input arguments:
% n:
%    NURBS order (2 for linear, 3 for quadratic, 4 for cubic, etc.)
% npts:
%    number of control points
% u:
%    point to evaluate
% t:
%    knot vector
%
% Output arguments:
% N:
%   vector with size npts containing value of the basis function at u
 
%Written by Graziano Fuccio, email: g.fuccio359@gmail.com
nplusc = npts + n;
N = zeros(npts);
 
for i = 1: nplusc - 1
    if u >= t(i) && u <= t(i+1)
        N(i) = 1;
    else
        N(i) = 0;
    end
end
 
%application of the formula that you can find on the NURBS book
for k = 2 : n
    for i = 1 : nplusc - k
        if N(i) ~= 0
            d = ((u - t(i)) * N(i)) / (t(i + k - 1) - t(i));
        else
            d = 0;
        end
        if(N(i + 1) ~= 0)
            e = ((t(i + k) - u) * N(i + 1)) / (t(i + k) - t(i + 1));
        else
            e = 0;
        end
        N(i) = d + e;
    end
end
 
N = N(:, 1);
N = N';
 
end
 

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

关键词: nurbs 曲线 matlab 程序源码 算例

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved