Squaring up structures / planning layout ... shortcut?

Hi All,

Suppose I'm building a simple rectangular structure and I lay out everything with string to establish the sides and elevation. Paralleling the strings is easy, but to square it up, I'd measure the diagonals, right? Well, is there an easier way than to shift, check, shift, check, shift, check to make them equal and thus square?

So, given a parallelogram with sides equal to X and Y, diagonals equal to D and E and unknown angles, is there a formula I can plug this in to such that I get answer that tells me how much to shift one side such that I get a rectangle with sides equal to X and Y, diagonals equal to D equal to E and 90 degree angles?

I have strings setup, but even with a helper, I think it's going to be tough to accurately measure the diagonals over and over again. Maybe set up extra batter boards to stretch a tape across?

Thanks,

Jason