The diagonal should form the hypotenuse of a right triangle.
You can just use the pythagorean theorem to find the hypotenuse of a right triangle.
a2 + b2 = c2
(If it is a square, a=b, but that doesn't really matter.)
Times the length of the square and √2.