Auxiliary section
In this section, auxiliary and complementary code is presented that may prove useful in various rough surface scattering simulations. The code includes algorithms for calculating and plotting amplitude and intensity reflection coefficients of various media [1], methods for converting between optical and dielectric constants and routines for computing distributions of surface normals och inclination angles (the angle between the local surface normal and a reference axis, usually the global surface normal).
Matlab code
Reflection coefficients
[rs,rp] = amprc (n,k,theta)INPUT: n-refractive index, k-extinction coefficient, theta-angle of incidence
OUTPUT: rs-amplitude reflection coefficient for s-polarized component, rp-amplitude reflection coefficient for p-polarized component
[Rs,Rp,R] = intrc (n1,n2,k2,theta)
INPUT: n1-refractive index of first medium, n2-refractive index of second medium, k2-extinction coefficient of second medium, theta-angle of incidence
OUTPUT: Rs-(intensity) reflection coefficient for s-polarized component, Rp-(intensity) reflection coefficient for p-polarized component, R-reflectivity for circular (or unpolarized) polarization
fresnelplot (n1,n2,k2,plotopt)
INPUT: n1-refractive index of first medium, n2-refractive index of second medium, k2-extinction coefficient of second medium, plotopt-plotting option (type 'R' for plotting reflectivity, 'A' for absorptivity or 'RA' for both)
OUTPUT: plot(s) of reflectivity and/or absorptivity as a function of angle of incidence
Optical and dielectric constants
[e1,e2] = oc2dc (n,k)INPUT: n-refractive index, k-extinction coefficient
OUTPUT: e1-real part of the dielectric constant, e2-imaginary part of the dielectric constant
[n,k] = dc2oc (e1,e2)
INPUT: e1-real part of the dielectric constant, e2-imaginary part of the dielectric constant
OUTPUT: n-refractive index, k-extinction coefficient
Surface normals and inclination angles
[nx,ny] = normals1D (f,x)INPUT: f-surface heights, x-surface points
OUTPUT: nx-x components or surface normals, ny-y components or surface normals
[nx,ny,nz] = normals2D (f,x,y)
INPUT: f-surface heights, x-surface points, y-surface points
OUTPUT: nx-x components or surface normals, ny-y components or surface normals, nz-z components or surface normals
iaplot1D (f,x,plotopt) - (requires normals1D)
INPUT: f-surface heights, x-surface points, plotopt-plotting option (type 'plot' for plotting the continuous distribution or 'hist' for plotting a histogram of the discrete distribution)
OUTPUT: plot of the distribution of inclination angles
iaplot2D (f,x,y,plotopt) - (requires normals2D)
INPUT: f-surface heights, x-surface points, y-surface points, plotopt-plotting option (type 'plot' for plotting the continuous distribution or 'hist' for plotting a histogram of the discrete distribution)
OUTPUT: plot of the distribution of inclination angles
References:
[1] Modest, M.: "Radiative Heat Transfer", Elsevier Science, 2nd Edition (2003).