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

📄 isgrade.m

📁 这是几何代数的matlab工具包
💻 M
字号:
function b=isGrade(A,g)% isGrade(A,g): return 1 if multivector A is of grade g%%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.b = 0; % assume wrong and set to 1 if rightif g==0	if sum(abs(A.m(2:8))) == 0		b = 1;	endelseif g==1	if sum(abs([A.m(1);A.m(5:8)])) == 0		b = 1;	endelseif g==2	if sum(abs([A.m(1:4);A.m(8)])) == 0		b = 1;	endelseif g==3	if sum(abs(A.m(1:7))) == 0		b = 1;	endelseif g==-1	z = A.m == 0;	z0 = z(1);	z1 = sum(z(2:4))~=0;	z2 = sum(z(5:7))~=0;	z3 = z(8);	% Note that the test treats 0 is a multivector!	if z0+z1+z2+z3 ~= 1		b = 1;	endelse	error('isGrade: invalid grade.');end

⌨️ 快捷键说明

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