A Square Window would have four equal sides. So you would use the Pythagorean Theorem (a²+b²=c²) to solve the problem. so it would be set up like this; 40²+40²=c². then you would evaluate it and it become:
400+400=c²
800=c²
√800=√c²
Answer: 28.3 inches