cartesian-distance calculates the distance between two points in cartesian space