formula for calculating the diagonal of a rectangle