Added distance calculation

used for minimal distance between emitters