From Electrostatics to Optics