||
%平面波,《光学》P81
clear all;clc
close all
% sin,cos,tan,cot,sec,csc三角函数(角度单位为弧度)
% asin,acos,atan,acot,asec,acsc反三角函数(角度单位为弧度)
% sind,cosd,tand,cotd,secd,cscd三角函数(角度单位为度)
% asind,acosd,atand,acotd,asecd,acscd反三角函数(角度单位为度.
lambda=632.8e-9;
E0=1;
k=2*pi/lambda;
Lx=0.05; % x方向范围
Ly=0.05;
x=linspace(-Lx/2,Lx/2,256);
y=linspace(-Ly/2,Ly/2,256);
[x0,y0]=meshgrid(x,y);
%===========方一=========
alpha=0.4*pi; %alpha,belta
belta=0.3*pi;
phi=k*(x0*cos(alpha)+y0*cos(belta));
E=E0.*exp(i*phi);
I=(1+E).*conj(1+E);
%I=(abs(1+E)).^2;
figure(1)
imshow(I,[]);colormap gray
%=============方二==============
alpha=45;belta=45;
phi=k.*(x0*cosd(alpha)+y0*cosd(belta));
EE=E0.*exp(i*phi);
phase=angle(EE);
figure(2)
imshow(mat2gray(phase))
figure(3)
mesh(phase);colormap jet
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-28 11:44
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社