I have two problems I'm hoping to solve with one equation for a game. This game uses a square for its key (rotates) but I'd prefer to treat it as a rectangle instead. I want to find the coordinates so I can find the angle of rotation of the box (programatically) from its perfect horizontal (y1 = y2) alignment.
I have the image below where I'm given X1, Y1, X2, Y2 and the length of a single OR both sides.
I'm trying to find (X2, Y1) and (X1, Y2) as shown below:
What I've tried? I tried to use the Pythagorean theorem but I don't have the angle.. I thought about using the distance formula to find the length of the diagonals and calculate the other coords using that but its a rectangle so that doesn't help much.
Any ideas how I can approach it?