Nearly free-photon approximation for two-dimensional photonic crystal slabs