function [n,k] = dc2oc(e1,e2)
%
% [n,k] = dc2oc(e1,e2)
%
% converts the complex dielectric constant e1+i*e2 to the 
% complex refractive index n+i*k.
%
% Input:  e1 - real part of dielectric constant
%         e2 - imaginart part of dielectric constant
%
% Output: n  - refractive index
%         k  - extinction coefficient
%
% Last updated: 2009-03-16
%

n = sqrt(1/2*(sqrt(e1^2 + e2^2) + e1));

k = sqrt(1/2*(sqrt(e1^2 + e2^2) - e1));