In this triangle \(a^2 = b^2 + c^2\) and angle \(A\) is a right angle. Pythagoras' theorem only works for right-angled triangles, so you can use it to test whether a triangle has a right angle or not.
The width and height of the rectangle become \(a\) and \(b\) in the formula and \(c\) is the diagonal length. Taking the triangle DEG, Pythagoras’ theorem can be used to calculate the length of EG.