I know the coordinates of 2 points A(xA,yA) and C(xC,yC) and a angle alpha. How to calculate coordinates of points B and D so as ABCD is a rectangle rotated of alpha
Sample with homemade ascii art :-)
A - - - - - - - -
| ------- ) alpha
| ------
| -------- B
D |
------- |
------ |
-----------
C
The general algorithm is to rotate the rectangle to be axis-aligned with a rotation matrix, then calculate the area. I'll let you translate it into the language of your choice. I've added comments with the matrix/ vector versions of what's going on. Note that the signs of
sin(theta)terms may all be backwards depending on your sign convention.