📄 gablock.m
字号:
disp('>> DrawHomogeneous(e,P,''n'',''b''); GAtext(1.07*P,''P''); % P'); DrawHomogeneous(e,P,'n','b'); GAtext(1.07*P,'P'); % P disp('>> DrawHomogeneous(e,Q,''n'',''b''); GAtext(1.07*Q,''Q''); % Q'); DrawHomogeneous(e,Q,'n','b'); GAtext(1.07*Q,'Q'); % Q disp('>> DrawHomogeneous(e,R,''n'',''b''); GAtext(1.07*R,''R''); %% R'); DrawHomogeneous(e,R,'n','b'); GAtext(1.07*R,'R'); %% R GAprompt; disp('>> DrawHomogeneous(e,PQ,''n'',''c''); %% PQ'); DrawHomogeneous(e,PQ,'n','c'); %% PQ GAprompt; disp('>> DrawHomogeneous(e,QR,''n'',''g''); %% QR'); DrawHomogeneous(e,QR,'n','g'); %% QR GAprompt; disp('>> DrawHomogeneous(e,meet(PQ,QR),''n'',''m''); % Meet of PQ, QR'); DrawHomogeneous(e,meet(PQ,QR),'n','m'); % Meet of PQ, QR GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> GAview([30 15]);'); GAview([30 15]); disp('>> DrawHomogeneous(e,P,''y'',''b''); % P'); DrawHomogeneous(e,P,'y','b'); % P disp('>> DrawHomogeneous(e,Q,''y'',''b''); % Q'); DrawHomogeneous(e,Q,'y','b'); % Q disp('>> DrawHomogeneous(e,R,''y'',''b''); % R'); DrawHomogeneous(e,R,'y','b'); % R disp('>> DrawHomogeneous(e,meet(PQ,QR),''n'',''m''); %% Meet of PQ, QR'); DrawHomogeneous(e,meet(PQ,QR),'n','m'); %% Meet of PQ, QR GAprompt; disp('>> draw(PQ,''c''); draw(QR,''g''); draw(meet(PQ,QR),''m''); %%'); draw(PQ,'c'); draw(QR,'g'); draw(meet(PQ,QR),'m'); %% GAprompt; disp('>> IP = {e-e1-e2,e-e1+2*e2,e+2*e1+2*e2,e+2*e1-e2};'); IP = {e-e1-e2,e-e1+2*e2,e+2*e1+2*e2,e+2*e1-e2}; disp('>> DrawPolygon(IP,''w'');'); DrawPolygon(IP,'w'); disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 13 ) GAps = 'GAblock >> '; disp('>> % CONNECTIONS OF LINES AND POINTS'); % CONNECTIONS OF LINES AND POINTS disp('>> clf;'); clf; disp('>> e = e3;'); e = e3; disp('>> P = e+ e1/4+e2/2;'); P = e+ e1/4+e2/2; disp('>> Q = e- e1/2+e2/4;'); Q = e- e1/2+e2/4; disp('>> R = e+ e1/3-e2/5;'); R = e+ e1/3-e2/5; disp('>> PQ = P^Q;'); PQ = P^Q; disp('>> PtoQ = connection(e,P,Q);'); PtoQ = connection(e,P,Q); disp('>> RtoPQ = connection(e,R,PQ) % a vector!'); RtoPQ = connection(e,R,PQ) % a vector! disp('>> PQtoR = connection(e,PQ,R) %% a bivector!'); PQtoR = connection(e,PQ,R) %% a bivector! GAprompt; disp('>> draw(e,''k'');'); draw(e,'k'); disp('>> DrawHomogeneous(e,P,''y'',''b''); GAtext(1.07*P,''P''); % P'); DrawHomogeneous(e,P,'y','b'); GAtext(1.07*P,'P'); % P disp('>> DrawHomogeneous(e,Q,''y'',''b''); GAtext(1.07*Q,''Q''); % Q'); DrawHomogeneous(e,Q,'y','b'); GAtext(1.07*Q,'Q'); % Q disp('>> DrawHomogeneous(e,R,''y'',''b''); GAtext(1.07*R,''R''); %% R'); DrawHomogeneous(e,R,'y','b'); GAtext(1.07*R,'R'); %% R GAprompt; disp('>> DrawHomogeneous(e,PQ,''n'',''g''); %% PQ'); DrawHomogeneous(e,PQ,'n','g'); %% PQ GAprompt; disp('>> DrawSimplex({P,P+PtoQ},''y'',''r''); %% segment P to Q'); DrawSimplex({P,P+PtoQ},'y','r'); %% segment P to Q GAprompt; disp('>> DrawSimplex({R,R+RtoPQ},''y'',''m''); %% segment R to PQ'); DrawSimplex({R,R+RtoPQ},'y','m'); %% segment R to PQ GAprompt; disp('>> DrawHomogeneous(e,R+RtoPQ,''n'',''k''); %% closest point on PQ'); DrawHomogeneous(e,R+RtoPQ,'n','k'); %% closest point on PQ GAprompt; disp('>> DrawHomogeneous(e,PQ+PQtoR,''n'',''k''); %% closest line through R'); DrawHomogeneous(e,PQ+PQtoR,'n','k'); %% closest line through R GAprompt; disp('>> IP = {e-e1-e2,e-e1+e2,e+e1+e2,e+e1-e2};'); IP = {e-e1-e2,e-e1+e2,e+e1+e2,e+e1-e2}; disp('>> DrawPolygon(IP,''w'');'); DrawPolygon(IP,'w'); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> Pline = P^PtoQ; % the line PQ: at P, tangent PtoQ'); Pline = P^PtoQ; % the line PQ: at P, tangent PtoQ disp('>> Rline = R^PtoQ; % the line at R parallel to PQ'); Rline = R^PtoQ; % the line at R parallel to PQ disp('>> DrawHomogeneous(e,Rline,''n'',''c''); %% Rline drawn'); DrawHomogeneous(e,Rline,'n','c'); %% Rline drawn GAprompt; disp('>> linecon = connection(e,Pline,Rline);'); linecon = connection(e,Pline,Rline); disp('>> DrawHomogeneous(e,Pline+linecon,''n'',''m''); %% translated Pline'); DrawHomogeneous(e,Pline+linecon,'n','m'); %% translated Pline GAprompt; GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> QR = join(Q,R);'); QR = join(Q,R); disp('>> intersect = meet(PQ,QR)/inner(e,meet(PQ,QR));'); intersect = meet(PQ,QR)/inner(e,meet(PQ,QR)); disp('>> linecon = connection(e,PQ,QR);'); linecon = connection(e,PQ,QR); disp('>> DrawSimplex({intersect,intersect+linecon},''y'',''k'');'); DrawSimplex({intersect,intersect+linecon},'y','k'); disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 14 ) GAps = 'GAblock >> '; disp('>> % NAPOLEAN''S THEOREM'); % NAPOLEAN'S THEOREM disp('>> clf;'); clf; disp('>> P1 = e3; P2 = e3+e1; P3 = e3+e2;'); P1 = e3; P2 = e3+e1; P3 = e3+e2; disp('>> DrawPolyline({P1,P2,P3,P1}, ''k''); GAview([0,90]);'); DrawPolyline({P1,P2,P3,P1}, 'k'); GAview([0,90]); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> i = e1^e2; RR = gexp(i*2*pi/3);'); i = e1^e2; RR = gexp(i*2*pi/3); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> S12 = (P1-P2)*RR+P1; DrawPolyline({P1,S12,P2}, ''b'');'); S12 = (P1-P2)*RR+P1; DrawPolyline({P1,S12,P2}, 'b'); disp('>> S23 = (P2-P3)*RR+P2; DrawPolyline({P2,S23,P3}, ''b'');'); S23 = (P2-P3)*RR+P2; DrawPolyline({P2,S23,P3}, 'b'); disp('>> S31 = (P3-P1)*RR+P3; DrawPolyline({P3,S31,P1}, ''b'');'); S31 = (P3-P1)*RR+P3; DrawPolyline({P3,S31,P1}, 'b'); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> C1 = (P1+S12+P2)/3;'); C1 = (P1+S12+P2)/3; disp('>> C2 = (P2+S23+P3)/3;'); C2 = (P2+S23+P3)/3; disp('>> C3 = (P3+S31+P1)/3;'); C3 = (P3+S31+P1)/3; disp('>> DrawPolyline({C1,C2,C3,C1},''r'');'); DrawPolyline({C1,C2,C3,C1},'r'); disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 15 ) GAps = 'GAblock >> '; disp('>> %PAPPUS''S THEOREM'); %PAPPUS'S THEOREM disp('>> clf'); clf disp('>> P1 = e3+e1; P2 = e3+2*e1; P3 = e3+4*e1;'); P1 = e3+e1; P2 = e3+2*e1; P3 = e3+4*e1; disp('>> Q1 = e3+e2; Q2 = e3+e1+2*e2; Q3 = e3+2*e1+3*e2;'); Q1 = e3+e2; Q2 = e3+e1+2*e2; Q3 = e3+2*e1+3*e2; disp('>> DrawPolyline({P1,P3},''r''); DrawPolyline({Q1,Q3},''r'');'); DrawPolyline({P1,P3},'r'); DrawPolyline({Q1,Q3},'r'); disp('>> DrawPolyline({P1,Q2},''k''); DrawPolyline({P1,Q3},''k'');'); DrawPolyline({P1,Q2},'k'); DrawPolyline({P1,Q3},'k'); disp('>> DrawPolyline({P2,Q1},''k''); DrawPolyline({P2,Q3},''k'');'); DrawPolyline({P2,Q1},'k'); DrawPolyline({P2,Q3},'k'); disp('>> DrawPolyline({P3,Q1},''k''); DrawPolyline({P3,Q2},''k'');'); DrawPolyline({P3,Q1},'k'); DrawPolyline({P3,Q2},'k'); disp('>> GAview([0,90]);'); GAview([0,90]); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> H3 = meet(join(P1,Q2),join(P2,Q1)); A3 = H3/inner(H3,e3);'); H3 = meet(join(P1,Q2),join(P2,Q1)); A3 = H3/inner(H3,e3); disp('>> H2 = meet(join(P1,Q3),join(P3,Q1)); A2 = H2/inner(H2,e3);'); H2 = meet(join(P1,Q3),join(P3,Q1)); A2 = H2/inner(H2,e3); disp('>> H1 = meet(join(P2,Q3),join(P3,Q2)); A1 = H1/inner(H1,e3);'); H1 = meet(join(P2,Q3),join(P3,Q2)); A1 = H1/inner(H1,e3); disp('>> DrawHomogeneous(e3,H1,''n'',''g'');'); DrawHomogeneous(e3,H1,'n','g'); disp('>> DrawHomogeneous(e3,H2,''n'',''g'');'); DrawHomogeneous(e3,H2,'n','g'); disp('>> DrawHomogeneous(e3,H3,''n'',''g'');'); DrawHomogeneous(e3,H3,'n','g'); disp('>> DrawPolyline({A1,A3},''b'')'); DrawPolyline({A1,A3},'b') disp(' '); disp('End of GAblock sequence. Returning to Matlab.');elseif ( GAn == 16 ) GAps = 'GAblock >> '; disp('>> %MORLEY''S TRIANGLE'); %MORLEY'S TRIANGLE disp('>> clf;'); clf; disp('>> P1 = e3; P2 = e3+e1; P3 = e3+e2;'); P1 = e3; P2 = e3+e1; P3 = e3+e2; disp('>> DrawPolyline({P1,P2,P3,P1}, ''k''); GAview([0,90]);'); DrawPolyline({P1,P2,P3,P1}, 'k'); GAview([0,90]); disp('>> R1 = (P3-P1)*(P2-P1); R13 = gexp(sLog(R1)/3);'); R1 = (P3-P1)*(P2-P1); R13 = gexp(sLog(R1)/3); disp('>> R2 = (P1-P2)*(P3-P2); R23 = gexp(sLog(R2)/3);'); R2 = (P1-P2)*(P3-P2); R23 = gexp(sLog(R2)/3); disp('>> R3 = (P2-P3)*(P1-P3); R33 = gexp(sLog(R3)/3);'); R3 = (P2-P3)*(P1-P3); R33 = gexp(sLog(R3)/3); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> L12 = P1^(R13*(P2-P1)); L13 = P1^((P3-P1)*R13);'); L12 = P1^(R13*(P2-P1)); L13 = P1^((P3-P1)*R13); disp('>> L23 = P2^(R23*(P3-P2)); L21 = P2^((P1-P2)*R23);'); L23 = P2^(R23*(P3-P2)); L21 = P2^((P1-P2)*R23); disp('>> L31 = P3^(R33*(P1-P3)); L32 = P3^((P2-P3)*R33);'); L31 = P3^(R33*(P1-P3)); L32 = P3^((P2-P3)*R33); GAps = 'Refer to the tutorial before continuing >> '; disp(' '); GAprompt; GAps = 'GAblock >> '; disp('>> H1 = meet(L12,L21); C1 = H1/inner(H1,e3); DrawHomogeneous(e3,H1,''n'',''y'')'); H1 = meet(L12,L21); C1 = H1/inner(H1,e3); DrawHomogeneous(e3,H1,'n','y') disp('>> H2 = meet(L23,L32); C2 = H2/inner(H2,e3); DrawHomogeneous(e3,H2,''n'',''y'')'); H2 = meet(L23,L32); C2 = H2/inner(H2,e3); DrawHomogeneous(e3,H2,'n','y') disp('>> H3 = meet(L31,L13); C3 = H3/inner(H3,e3); DrawHomogeneous(e3,H3,''n'',''y'')'); H3 = meet(L31,L13); C3 = H3/inner(H3,e3); DrawHomogeneous(e3,H3,'n','y') disp('>> DrawPolyline({P1,C1,P2},''g'')'); DrawPolyline({P1,C1,P2},'g') disp('>> DrawPolyline({P2,C2,P3},''g'')'); DrawPolyline({P2,C2,P3},'g') disp('>> DrawPolyline({P3,C3,P1},''g'')'); DrawPolyline({P3,C3,P1},'g') disp('>> DrawPolyline({C1,C2,C3,C1},''r'')'); DrawPolyline({C1,C2,C3,C1},'r') disp(' '); disp('End of GAblock sequence. Returning to Matlab.');endcatch ; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -