% illustrating the concept of polarization of plane wave % parameters of x,y components of plane wave's amplitude a1=1; d1=0; a2=1; d2=-pi/4; %calculating the amplitudes and frequency ax=a1*exp(1i*d1); ay=a2*exp(1i*d2); omg=1; %setting up time array tPts=100; tArr=linspace(0,2*pi/omg,tPts+1); %setting up coordinate grid to plot the vector field xArr=(-6:2:6); [x,y]=meshgrid(xArr,xArr); % assembling the movie fig=figure(1); F(tPts)=struct('cdata',[],'colormap',[]); for it=1:tPts t=tArr(it); phs=exp(-1i*omg*t+0i*x+0i*y); %phase of the wave quiver(x,y, real(ax*phs),real(ay*phs),0, 'linewidth',2) xlim(7.5*[-1 1]) ylim(7.5*[-1 1]) daspect([1 1 1]) title(['S_0=',num2str(a1^2+a2^2,3),... '; S_1=', num2str(a1^2-a2^2,3),... '; S_3=', num2str(2*a1*a2*cos(d2-d1),3),... '; S_4=', num2str(2*a1*a2*sin(d2-d1),3)]) set(gca,'FontSize',16) set(gca,'xtick',[],'ytick',[]) xlabel('x'); ylabel('y') box on drawnow F(it)=getframe(gcf); end %playing the movie % movie(fig,F,2)