/// <summary> /// Computes the refractive index of a material for given wavelength /// with respect to dispersion. /// </summary> /// <remarks> /// Dispersion formula is the Sellmeier equation, /// http://en.wikipedia.org/wiki/Sellmeier_equation. /// </remarks> /// <param name="wavelength">Wavelength of the light (in micrometers).</param> /// <param name="material">Description of the material.</param> /// <returns>Refractive index of the material at given wavelegth.</returns> public static double DispersedRefractiveIndex( DispersionRecord material, double wavelength) { double lambdaSqr = Math.Pow(wavelength, 2); double refractiveIndex = 1 + material.C1 * lambdaSqr / (lambdaSqr - material.C2) + material.C3 * lambdaSqr / (lambdaSqr - material.C4); if ((material.C5 != 0) && (material.C6 != 0)) { refractiveIndex += material.C5 * lambdaSqr / (lambdaSqr - material.C6); } refractiveIndex = Math.Sqrt(refractiveIndex); return(refractiveIndex); }
/// <summary> /// Computes the refractive index of a material for given wavelength /// with respect to dispersion. /// </summary> /// <remarks> /// Dispersion formula is the Sellmeier equation, /// http://en.wikipedia.org/wiki/Sellmeier_equation. /// </remarks> /// <param name="wavelength">Wavelength of the light (in micrometers).</param> /// <param name="material">Description of the material.</param> /// <returns>Refractive index of the material at given wavelegth.</returns> public static double DispersedRefractiveIndex( DispersionRecord material, double wavelength) { double lambdaSqr = Math.Pow(wavelength, 2); double refractiveIndex = 1 + material.C1 * lambdaSqr / (lambdaSqr - material.C2) + material.C3 * lambdaSqr / (lambdaSqr - material.C4); if ((material.C5 != 0) && (material.C6 != 0)) { refractiveIndex += material.C5 * lambdaSqr / (lambdaSqr - material.C6); } refractiveIndex = Math.Sqrt(refractiveIndex); return refractiveIndex; }