  The design of far-field radiation diagrams from combined electric and
magnetic dipolar sources has recently found applications in nanophotonic
metasurfaces that realize tailored reflection and refraction. Such dipolar
sources also exhibit important near-field evanescent coupling properties with
applications in polarimetry and quantum optics. Here we introduce a rigorous
theoretical framework for engineering the angular spectra encompassing both
far- and near-fields of electric and magnetic sources and develop a unified
description of both free space and guided mode directional radiation. The
approach uses the full parametric space of six complex-valued components of
magnetic and electric dipoles in order to engineer constructive or destructive
near-field interference. Such dipolar sources can be realized with dielectric
or plasmonic nanoparticles. We show how a single dipolar source can be designed
to achieve the selective coupling to multiple waveguide modes and far-field
simultaneously with a desired amplitude, phase, and direction.
