The total electric flux normal to a closed surface in an electric field is proportional to the algebraic sum of the electric charges within the surface. A similar law applies to surfaces drawn in a magnetic field and the law can be generalized for any vector field through a closed surface. It was first stated by Karl Gauss.