The Talbot and Lau effects of Ronchi gratings are treated by the ambiguity function in this paper. Furthermore, both effects are developed is fit any optical systems. Because of quasi-ray-optical operation of the AF, two general formulas directly describing the patterns of the Talbot and Lau fringes respectively are derived in a quite simple form. All the variables in the formulas depend only on the transfer matrices of the optical system used. The Talbot and Lau effects of complex gratings are also discussed.