A Unified Representation and Transformation of Electromagnetic Configurations Based on Generalized Hertz Potentials