clear all; close all; dy=[-10:0.5:10]; dx=dy; for i=1:length(dx) for j=1:length(dy) testAtan(j,i)=atan2(dy(j),dx(i)); if dx(i)==0 testAtan_bis(j,i)=atan2(dy(j),dx(i)); else testAtan_bis(j,i)=atan(dy(j)/dx(i)); end end end figure; surf(dx,dy,testAtan) title('atan(dy/dx)') figure; surf(dx,dy,testAtan_bis) title('atan(dy/dx)') % figure; % Q=unwrap(unwrap(testAtan)')'; % surf(dx,dy,Q) % title('atan(dy/dx)')