fig5_17.m

来自「these are the Mtlab functions to plot th」· M 代码 · 共 26 行

M
26
字号
%motion field for camera motions

%zoom

rho=0.5;
for (i=1:11) for (j=1:11) 
      x=i-6;y=j-6;
      u(i,j)=(1-rho)*y; v(i,j)=(1-rho)*x; 
   end;end;
figure;
quiver(u,v)
axis image;  axis([1,11,1,11]); set(gca,'ytick',[]);set(gca,'xtick',[]);


%rotation
thetaz=15*pi/180;
for (i=1:11) for (j=1:11) 
      x=i-6;y=j-6;
      u(i,j)=sin(thetaz)*x+cos(thetaz)*y-y; 
      v(i,j)=cos(thetaz)*x-sin(thetaz)*y-x; 
   end;end;
figure;
quiver(u,v)
axis image;  axis([1,11,1,11]); set(gca,'ytick',[]);set(gca,'xtick',[]);

⌨️ 快捷键说明

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