📄 gablock.m
字号:
% MEET AND JOIN DECOMPOSED disp('>> A = e2^(e1+e3);'); A = e2^(e1+e3); disp('>> B = e1^(e2+e3/2);'); B = e1^(e2+e3/2); disp('>> aAB = geoall(A,B);'); aAB = geoall(A,B); disp('>> M = aAB.meet;'); M = aAB.meet; disp('>> clf;'); clf; disp('>> DrawBivector(A/M,M,''b''); % draw A, decomposed'); DrawBivector(A/M,M,'b'); % draw A, decomposed disp('>> DrawBivector(M,1/M*B,''g''); %% draw B, decomposed'); DrawBivector(M,1/M*B,'g'); %% draw B, decomposed GAprompt; disp('>> DrawBivector(aAB.proj/M,M,''c''); % draw proj, decomposed'); DrawBivector(aAB.proj/M,M,'c'); % draw proj, decomposed disp('>> DrawBivector(aAB.rej/M,M,''m''); %% draw rej, decomposed'); DrawBivector(aAB.rej/M,M,'m'); %% draw rej, decomposed GAprompt; disp('>> draw(aAB.comp,''r'');'); draw(aAB.comp,'r'); disp('>> draw(aAB.meet,''k'');'); draw(aAB.meet,'k'); disp('>> draw(aAB.join,''y'');'); draw(aAB.join,'y'); disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 8 ) GAps = 'GAblock >> '; disp('>> % PINHOLE IMAGING'); % PINHOLE IMAGING disp('>> clf;'); clf; disp('>> e = e1;'); e = e1; disp('>> %==== indicate focal point and image plane:'); %==== indicate focal point and image plane: disp('>> draw(e,''k'');'); draw(e,'k'); disp('>> IP = {e1+e3+e2,e1+e3-e2,e1-e3-e2,e1-e3+e2,e1+e3+e2}; % image plane rectangle'); IP = {e1+e3+e2,e1+e3-e2,e1-e3-e2,e1-e3+e2,e1+e3+e2}; % image plane rectangle disp('>> DrawPolygon(IP,''y'') %% The image plane'); DrawPolygon(IP,'y') %% The image plane GAprompt; disp('>> %==== vector x and its projection'); %==== vector x and its projection disp('>> x = 3*e1 - 1.5*e2 + 2*e3;'); x = 3*e1 - 1.5*e2 + 2*e3; disp('>> px = x/inner(x,e);'); px = x/inner(x,e); disp('>> draw(x,''b''); %% Draw x'); draw(x,'b'); %% Draw x GAprompt; disp('>> DrawSimplex({px},''r'',''r'');'); DrawSimplex({px},'r','r'); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> y = 1.8*e1 + 1.5*e2 + e3;'); y = 1.8*e1 + 1.5*e2 + e3; disp('>> u = y-x;'); u = y-x; disp('>> U = x^y;'); U = x^y; disp('>> d = U/u;'); d = U/u; disp('>> clf; draw(e1,''k''); DrawPolygon(IP,''w''); % Redraw e and the image plane'); clf; draw(e1,'k'); DrawPolygon(IP,'w'); % Redraw e and the image plane disp('>> DrawPolygon({GA(0),x,y},''y''); % Draw Polygon'); DrawPolygon({GA(0),x,y},'y'); % Draw Polygon disp('>> draw(d,''g''); draw(x); draw(y); %% Draw x and y and support'); draw(d,'g'); draw(x); draw(y); %% Draw x and y and support GAprompt; disp('>> DrawSimplex({x,y},''n'',''g''); %% Draw line'); DrawSimplex({x,y},'n','g'); %% Draw line GAprompt; disp('>> uprime = inner(e1,U);'); uprime = inner(e1,U); disp('>> dprime = U/uprime;'); dprime = U/uprime; disp('>> draw(dprime,''r''); %% Draw proj support'); draw(dprime,'r'); %% Draw proj support GAprompt; disp('>> DrawSimplex({px,px+unit(uprime)},''n'',''r''); %% Projected line'); DrawSimplex({px,px+unit(uprime)},'n','r'); %% Projected line GAprompt; disp('>> DrawSimplex({e1,dprime},''n'',''m''); %% Perpendicular support in plane'); DrawSimplex({e1,dprime},'n','m'); %% Perpendicular support in plane GAprompt; disp('>> GAview([-30 10])'); GAview([-30 10]) disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 9 ) GAps = 'GAblock >> '; disp('>> % HOMOGENEOUS REPRESENTATION'); % HOMOGENEOUS REPRESENTATION disp('>> e = e3; % direction of extra dimension'); e = e3; % direction of extra dimension disp('>> clf; draw(e,''k'')'); clf; draw(e,'k') disp('>> p = e1+e2/2;'); p = e1+e2/2; disp('>> P = e+p; % point representation'); P = e+p; % point representation disp('>> U = 1;'); U = 1; disp('>> DrawHomogeneous(e,P^U,''y'',''b'') %% point'); DrawHomogeneous(e,P^U,'y','b') %% point GAprompt; disp('>> V = e2-e1/3;'); V = e2-e1/3; disp('>> DrawHomogeneous(e,P^V,''y'',''r'') %% line segment'); DrawHomogeneous(e,P^V,'y','r') %% line segment GAprompt; disp('>> W = e1^e2;'); W = e1^e2; disp('>> DrawHomogeneous(e,P^W,''y'',''g'') % plane segment'); DrawHomogeneous(e,P^W,'y','g') % plane segment disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 10 ) GAps = 'GAblock >> '; disp('>> % HOMOGENEOUS BIVECTOR REPRESENTATION OF A LINE'); % HOMOGENEOUS BIVECTOR REPRESENTATION OF A LINE disp('>> clf;'); clf; disp('>> e = e3; % the extra dimension of the homogeneous embedding'); e = e3; % the extra dimension of the homogeneous embedding disp('>> p = e1/3+e2; % position of point P'); p = e1/3+e2; % position of point P disp('>> q = e1+e2/2; % position of point Q'); q = e1+e2/2; % position of point Q disp('>> P = e+p; % homogeneous representation of P'); P = e+p; % homogeneous representation of P disp('>> Q = e+q; % homogeneous representation of Q'); Q = e+q; % homogeneous representation of Q GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> PQ = join(P,Q); % homogeneous representation of the line join(P,Q)'); PQ = join(P,Q); % homogeneous representation of the line join(P,Q) disp('>> DrawSimplex({P},''y'',''b''); DrawSimplex({Q},''y'',''b'');'); DrawSimplex({P},'y','b'); DrawSimplex({Q},'y','b'); disp('>> draw(PQ,''g'') %% the 2-blade PQ drawn as a planar tangent'); draw(PQ,'g') %% the 2-blade PQ drawn as a planar tangent GAprompt; disp('>> DrawBivector(P,Q,''y'') %% the 2-blade redrawn'); DrawBivector(P,Q,'y') %% the 2-blade redrawn GAprompt; disp('>> DrawSimplex({P,Q},''n'',''r''); % the line segment PQ'); DrawSimplex({P,Q},'n','r'); % the line segment PQ disp('>> DrawSimplex({e,e+2*e1,e+2*e2},''n'',''w''); %% the plane of 2-space'); DrawSimplex({e,e+2*e1,e+2*e2},'n','w'); %% the plane of 2-space GAprompt; disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 11 ) GAps = 'GAblock >> '; disp('>> % HOMOGENEOUS REPRESENTATION OF OFFSET SUBSPACES '); % HOMOGENEOUS REPRESENTATION OF OFFSET SUBSPACES disp('>> e = e3; % the extra dimension of the homogeneous embedding'); e = e3; % the extra dimension of the homogeneous embedding disp('>> p = e1/3+e2; % position of point P'); p = e1/3+e2; % position of point P disp('>> q = e1+e2/2; % position of point Q'); q = e1+e2/2; % position of point Q disp('>> P = e+p; % homogeneous representation of P'); P = e+p; % homogeneous representation of P disp('>> Q = e+q; % homogeneous representation of Q'); Q = e+q; % homogeneous representation of Q disp('>> PQ = join(P,Q); % homogeneous representation of the line join(P,Q)'); PQ = join(P,Q); % homogeneous representation of the line join(P,Q) disp('>> clf; draw(e,''k'');'); clf; draw(e,'k'); disp('>> DrawHomogeneous(e,P,''y'',''b''); GAtext(1.07*P,''P''); % Draw P'); DrawHomogeneous(e,P,'y','b'); GAtext(1.07*P,'P'); % Draw P disp('>> DrawHomogeneous(e,Q,''y'',''g''); GAtext(1.07*Q,''Q'') %% Draw Q'); DrawHomogeneous(e,Q,'y','g'); GAtext(1.07*Q,'Q') %% Draw Q GAprompt; disp('>> DrawHomogeneous(e,PQ,''y'',''r'');'); DrawHomogeneous(e,PQ,'y','r'); disp('>> GAorbiter(30,2);'); GAorbiter(30,2); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> IP = {e-e1/2-e2/2,e+3/2*e1-e2/2,e+3/2*e1+3/2*e2,e-e1/2+3/2*e2};'); IP = {e-e1/2-e2/2,e+3/2*e1-e2/2,e+3/2*e1+3/2*e2,e-e1/2+3/2*e2}; disp('>> DrawPolygon(IP,''w'');'); DrawPolygon(IP,'w'); disp('>> GAview([0 90]);'); GAview([0 90]); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> DrawHomogeneous(e,join(P,P),''n'',''b'');'); DrawHomogeneous(e,join(P,P),'n','b'); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> r = e1/2-e2/4;'); r = e1/2-e2/4; disp('>> R = e+r;'); R = e+r; disp('>> DrawHomogeneous(e,join(join(P,Q),R),''n'',''g'');'); DrawHomogeneous(e,join(join(P,Q),R),'n','g'); disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 12 ) GAps = 'GAblock >> '; disp('>> % LINE INTERSECTION AS MEET OF HOMOGENEOUS BIVECTORS'); % LINE INTERSECTION AS MEET OF HOMOGENEOUS BIVECTORS disp('>> clf;'); clf; disp('>> e = e3; % extra dimension of the homogeneous embedding'); e = e3; % extra dimension of the homogeneous embedding disp('>> P = e+ e1/3+e2; % point P'); P = e+ e1/3+e2; % point P disp('>> Q = e+ e1+e2/2; % point Q'); Q = e+ e1+e2/2; % point Q disp('>> R = e+ e1/2-e2/4; % point R'); R = e+ e1/2-e2/4; % point R disp('>> PQ = join(P,Q); % line PQ'); PQ = join(P,Q); % line PQ disp('>> QR = join(Q,R); % line QR'); QR = join(Q,R); % line QR disp('>> meet(PQ,QR) % intersection of those lines'); meet(PQ,QR) % intersection of those lines GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> clf;'); clf; disp('>> draw(e,''k'');'); draw(e,'k'); disp('>> GAview([0 90]);'); GAview([0 90]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -