%pol_wave_demo.m %1/15/01 TDM % %input vector: state = two-element jones vector % first element is the y axis % second element is teh z axis % the propagation direciton is x % On the plot, the wave travels to the right as % if the axes are assigned to the "convention" % of having xy polarization axes and z propagation. % I did it this way to simplify the matlab code. % The user enters the polarization "state" vector % external to this program like the xy convention. % That is, state = [1 1] looks like linear along % 45 degrees in a conventional drawing. Npts = 30; xvec = linspace(0,1,Npts); yvec = zeros(1,Npts); zvec = zeros(1,Npts); uvec = zeros(1,Npts); tvec = 0:0.1:2; figure(2); for t = tvec vvec = real(state(1)*exp(2*pi*i*(xvec-t))); wvec = real(state(2)*exp(2*pi*i*(xvec-t))); rho_vec = (vvec.*vvec + wvec.*wvec).^(0.5); max_plot = max(rho_vec); quiver3(xvec,yvec,zvec,uvec,vvec/max_plot,wvec/max_plot,0,'.','filled'); view([30 30]) axis([0 1 -1 1 -1 1]) pause(1) end