OptiGrating is a complex grating that is approximated by a sequence of uniform segments, and analyzed by connecting the segments with the well-known Transfer Matrix Method. This gives the designer the information needed to test and optimize grating designs.