Calculates distance to the specified point.
0.0 if point is inside the box or euclidean distance otherwise.