  The paper presents a derivation of analytical components of S-matrices for
arbitrary planar diffractive structures and metasurfaces in the Fourier domain.
Attained general formulas for S-matrix components can be applied within both
formulations in the Cartesian and curvilinear metric. A numerical method based
on these results can benefit from all previous improvements of the Fourier
domain methods. In addition, we provide expressions for S-matrix calculation in
case of periodically corrugated layers of 2D materials, which are valid for
arbitrary corrugation depth-to-period ratios. As an example the derived
equations are used to simulate resonant grating excitation of graphene plasmons
and an impact of silica interlayer on corresponding reflection curves.
