Do you need to find the length of a side of the square?
Do you need to find the distance from the barn to the fourth corner of the square?
Those with a lust for algebraic manipulation can pursue the problem using multiple Pythagorean relationships. . .
This problem has been published in various forms. One version is in the design of a jewel box with a gem to be mounted in the square lid of the jewel box 5 inches, 8 inches, and 13 inches from respective corners. Usually, algebraic solutions have been published.
Could the distance of 13 be from E to B rather than from D to B? Different result?
Could B be located outside the square?