A method to design gratings in integrated photonics, is presented. The based on a transfer matrix formalism enhanced by Finite Element Method (FEM) parameter calculations. main advantages of the proposed technique are easy use, fast optimization time and versatility approach. Few examples optimized obtain various scattered light field profiles for different applications presented: double-Gaussi...