Electrostatics and its applications