Orientational dependence of the elastic energy of a plane interlayer in a system of coherent phases