calculate distances between points in a quadrangle
add another condition to only detect squares, not non-equilateral rectangles