densityDistance function

Difference in layer density