typo
rectangular distance function corrected
rectangular distamce function extended for arbitrary dimensions