I am running this code on MatLab:
function main
fimplicit (@(x,y)f(x,y),[2 5])
end
function fun = f(x,y)
nc=1.45;
nf=1.5;
ns=1.4;
h=5;
kappa=sqrt(x^2*nf^2-y.^2);
gammas=sqrt(y^2-x^2*ns^2);
gammac=sqrt(y^2-x^2*nc^2);
z=sin(h.*kappa);
fun=z.*(kappa.^2-gammas.*gammac)-cos(h.*kappa).*(gammac+gammas).*kappa;
end
I got: (notice the wavy top line and dotted lower line)
Then I zoomed in around (2.5,3.5): (Notice the waves disappears)
Again I zoomed out and in again: (notice only staright lines remain):
1) Why am I getting such erratic behaviour.
2) What can be done to correct this since I need graphs for college work and cant use these.
Thanks !