Create PathDist.m

Helper function to calculate the path distance.