demodercrv.m

来自「强大的nurbs的工具箱 nurbs曲线」· M 代码 · 共 33 行

M
33
字号
function demodercrv
% Demonstrates the construction of a general
% curve and determine of the derivative.
%

% D.M. Spink
% Copyright (c) 2000

% make and draw nurbs test curve
crv = nrbtestcrv;
nrbplot(crv,48);
title('First derivatives along a test curve.');

npts = 9;
tt = linspace(0.0,1.0,npts);

dcrv = nrbderiv(crv);

% first derivative
[p1, dp] = nrbdeval(crv,dcrv,tt);

p2 = vecnorm(dp);

hold on;
plot(p1(1,:),p1(2,:),'ro');
h = quiver(p1(1,:),p1(2,:),p2(1,:),p2(2,:),0);
set(h,'Color','black');
hold off;




⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?