Real-space approach to calculation of electric polarization and dielectric constants.