Plasmonic and photonic scattering and near fields of nanoparticles