Three-dimensional vector coupled-wave analysis of planar-grating diffraction | Synapse