yefj
Advanced Member level 5

Hello , i am trying to control the direction of the wave traveling as shown in the code bellow.
When i put 45 degrees in theta_in_rad=45 i get the good photo shown bellow.
but the i put 90 degrees it stays diagonal instead being traveling rottated 90 degrees.
i am plotting the real part of the field to understand how it propagates
1.why we need to use the real part to see the direction of propogation?
2.why 90 degrees doesnt work for my code?
Thanks.
When i put 45 degrees in theta_in_rad=45 i get the good photo shown bellow.
but the i put 90 degrees it stays diagonal instead being traveling rottated 90 degrees.
i am plotting the real part of the field to understand how it propagates
1.why we need to use the real part to see the direction of propogation?
2.why 90 degrees doesnt work for my code?
Thanks.
Code:
clc
clear all
f=6;
lambda=300/6;
theta_in_rad=45;
theta_out_rad=70/180*pi;
x=linspace(-15*lambda,15*lambda,1000);
y=linspace(-15*lambda,15*lambda,1000);
[xx,yy]=meshgrid(x,y);
k=2*pi/lambda;
E_i=1;
E_r=E_i*sqrt(cos(theta_in_rad)/cos(theta_out_rad))
eta=377;
D_x=1.064*lambda;
k_x=k*sin(theta_in_rad)+2*pi/D_x;
k_y=sqrt(k^2-k_x.^2);
%E_t=E_i.*exp(-j*k*xx*sin(theta_in_rad)+j*k*yy*cos(theta_in_rad))+E_r.*exp(-j*k_x*xx-j*k_y*yy);%E_z
E_t=E_i.*exp(-j*k*xx*sin(theta_in_rad)+j*k*yy*cos(theta_in_rad));%E_z
figure;
imagesc(x/lambda,y/lambda,real(E_t))
xlabel('x [\lambda]')
ylabel('y [\lambda]')
colorbar;