gadvectors.m

来自「这是几何代数的matlab工具包」· M 代码 · 共 33 行

M
33
字号
% 	VECTORSGAfigure; clc; %/% 	VECTORSglobal v w; %/clf; %/%	Vectors can be defined using coordinates:v = e1 + e2;w = e2 + 2*e3;draw(v,'b');GAtext(0.5*v -0.1*unit(w),'v'); %/draw(w,'g');GAtext(0.5*w-0.1*unit(v),'w'); %/ axis('vis3d'); %/va = [-0.1 1 0 2 -0.1 2]; %/axis(va); %/GAprompt; %/GAorbiter(60,6); %/GAprompt; %/% 	Adding vectors, as usual:v+wdraw(v+w,'r'); %/GAtext(0.7*(v+w) -0.1*unit(w),'v+w'); %/DrawPolyline({v,v+w},'k'); %/DrawPolyline({w,v+w},'k'); %/% 	But vector addition is coordinate-free,%	so we will drop the axes.axis(va); %/GAprompt; %/axis off; %/GAprompt; %/%	Vectors `are' geometrical objects in space.GAorbiter(360,10); %/

⌨️ 快捷键说明

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