The Transfer-Matrix Method in Electromagnetics and Optics