inhLMabs (Matlab version) 
Jeppe Revall Frisvad

Abstract  This source code is a Matlab implementation of the LorenzMie phase
function that includes the case of an inhomogeneous incident wave using
the formulas presented in the following article
Jeppe Revall Frisvad. Phase function of a spherical particle
when scattering an inhomogeneous electromagnetic plane wave.
Journal of the Optical Society of America A 35(4):669680.
April 2018.
Some notes on which files to use:
 The script plot_iwave_phase_evanescent.m is an example of an evanescent wave scattered by a spherical particle (Figure 5 in the article).
 The script plot_iwave_phase_slice.m is an example of a hypothetical inhomogeneous wave scattered by a small gold particle (Figure 6 in the article).
 The script plot_iwave_phase_buried.m is an example of a wave refracted into an absorbing medium at an oblique angle and scattered by a spherical particle (Figure 8 in the article).
 Calculation of the LorenzMie coefficients is the same as in the LMabs code based on my SIGGRAPH 2007 publication ("Computing the scattering properties ...").
Permission is granted to anyone to use this code as
software for any purpose, including commercial applications.
However, the software is provided 'asis' without any warranty. 
Keywords  scattering, LorenzMie theory, phase function, inhomogeneous wave, absorbing media 
Type  Software 
Year  2018 Month April 
Publisher  Technical University of Denmark 
Electronic version(s)  [zip] 
Publication link  http://people.compute.dtu.dk/jerf/code/phase/ 
BibTeX data  [bibtex] 
IMM Group(s)  Image Analysis & Computer Graphics 