def complex_transmission_reflection(in_m0,in_m1,in_m2):
  """
  complex_transmission_reflection(in_m0,in_m1,in_m2)

  Calculate the complex transmission and reflection coefficients between
  media 0, 1, and 2 given their complex refractive indices.
  In the Kramers-Kronig implementation (in which this is most likely used
  in the context of Omnifit) media 0, 1, and 2 correspond
  respectively to the vacuum, ice, and substrate.

  Parameters
  ----------
  in_m0 : `complex` or `numpy.ndarray`
    The complex refractive index of medium 0.
  in_m1 : `complex` or `numpy.ndarray`
    The complex refractive index of medium 1.
  in_m2 : `complex` or `numpy.ndarray`
    The complex refractive index of medium 2.

  Returns
  -------
  A tuple containing the following elements:
    * The complex transmission coefficient between media 0 and 1
    * The complex transmission coefficient between media 0 and 2
    * The complex transmission coefficient between media 1 and 2
    * The complex reflection coefficient between media 0 and 1
    * The complex reflection coefficient between media 0 and 2
    * The complex reflection coefficient between media 1 and 2
  """
  complex_transmission = lambda m1,m2: (2.*m1.real)/(m1+m2)
  complex_reflection = lambda m1,m2: (m1-m2)/(m1+m2)
  return (
          complex_transmission(in_m0,in_m1),
          complex_transmission(in_m0,in_m2),
          complex_transmission(in_m1,in_m2),
          complex_reflection(in_m0,in_m1),
          complex_reflection(in_m0,in_m2),
          complex_reflection(in_m1,in_m2)
        )