in the present paper, resonant frequencies and modes of a three-atom photonic molecule and a photonic crystal placed within a cavity are numerically calculated. first, governing formulation in transverse electric field mode (te) is obtained using maxwell equations. then, an algorithm based on a finite difference scheme and matrix algebra is presented. the algorithm is then implemented in a comp...