Added distances calculation functions, added point's potential calculation.