⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 biarrow.m

📁 这是几何代数的matlab工具包
💻 M
字号:
function biarrow(iA,iB,c)% biarrow(A,B,c): draw an arrow from the head of B to the head of A in color c%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.if nargin == 2    c = 'b';endA = GAZ(iA);B = GAZ(iB);if GAisa(A,'vector')==0 | GAisa(B,'vector')==0   error('Can only draw arrow for vector');endplot3([B.m(2) A.m(2)+B.m(2)], [B.m(3) A.m(3)+B.m(3)], [B.m(4) A.m(4)+B.m(4)], c);% Construct a vector perpendicular to A-BlA = sqrt(inner(A,A));% Numerical problems require us to extract the vector portionif abs(A.m(4)) < lA*.9   p1 = grade((e3^A)*inverse(A),1);else   p1 = grade((e2^A)*inverse(A),1);endhold onp2 = dual(p1^A);lS = lA*.9;p1 = (0.04*lS/sqrt(double(inner(p1,p1))))*p1;p2 = (0.04*lS/sqrt(double(inner(p2,p2))))*p2;pA = A/lA*lS;% Cell array versiont = (0:pi/4:2*pi);head = cell(2,length(t));% Pre add to reduce the cost belowpAB = pA+B;AB = A+B;for i=1:length(t)    % Work with matrices to reduce calls to GAExpand    head{1,i} = GA(sin(t(i))*p1.m + cos(t(i))*p2.m + pAB.m);    head{2,i} = AB;endGALineMesh(head,c);

⌨️ 快捷键说明

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