📄 drawpolygon.m
字号:
function DrawPolygon(P,c)% DrawPolygon(P,c) - draw a polygon along the tips of the vector arguments% P: a cell array of GA vectors% c: an optional color argument%%See also gable.% GABLE, Copyright (c) 1999, University of Amsterdam% Copying, use and development for non-commercial purposes permitted.% All rights for commercial use reserved; for more information% contact Leo Dorst (leo@wins.uva.nl).%% This software is unsupported.l = length(P);if l < 2 error('DrawPolygon: requires at least two vector arguments');endif nargin == 1 c = 'b';elseif nargin > 2 error('DrawPolygon: takes only 2 arguments');endx = zeros(1,l);y = zeros(1,l);z = zeros(1,l);for i = 1:l v = m(GA(P{i})); if ~GAisa(GAZ(P{i}),'vector') error('DrawPolygon: all objects in P must be vectors.'); end x(i) = v(2); y(i) = v(3); z(i) = v(4);endpatch(x,y,z,c);hold on;axis('equal');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -