上传者: longgyy
|
上传时间: 2021-12-11 17:26:03
|
文件大小: 1KB
|
文件类型: -
MATLAB生成光通过三稜镜色散动画
部分源码
function optics_prism
close all
figure('position',[78 276 792 402]);
xp=[-0.2,0.2,0];yp=[0.2,0.2,0.5];B=pi/14;
ZZ=[xp;yp]'*[cos(B),sin(B);-sin(B),cos(B)];
fill(ZZ(:,1),ZZ(:,2),[0.2,0.4,0.6]);
axis([-1,1,0,1]);hold on;set(gca,'color','k');
t=0;A=pi/8;set(gcf,'doublebuffer','on');
x=[-1,-1];y=[0,0];
H=plot(x,y,'w','linewidth',6);
while t<0.8;
pause(0.1);