distance_dist function

Collecting all pairwise distances between input planes.