Computing the area of, or integrating over, a rectangle aligned with the x and y axes is really straightforward. Indeed, if $x \in [-\frac{b}{2},\frac{b}{2}]$ and $y \in [-\frac{y}{2},\frac{y}{2}]$, then:
\begin{equation} A= \int_{-a/2}^{a/2}\int_{-b/2}^{b/2}dxdy=ab \end{equation}
as expected.
My question is: how can I generalize this to the case where the rectangle is rotated by an angle $\theta$ with respect of the vertical axis?
I've tried different paths: parametrizing every side of the rectangle and trying to perform the usual integration (I get 0 since every parallel side is parametrized by an independent parameter, leading to either $\vec{t_u}$ or $\vec{t_v}$ being zero and hence $\|\vec{t_u}\times \vec{t_v}\|=0$); also trying to get a function (x as a function of y or viceversa) for each side, getting nowhere, or even trying to characterize every side with polar coordinates (as done in Integrating a function over a square using polar coordinates), leading to an indetermination.
My final goal is to integrate a function over several rotated rectangles in R3 to show that it will be equivalent to integrating over a circle. Any suggestion is appreciated.
Suppose you have 4 points describing a rotated rectangle.
What we aim to do is rotate the coordinate plane in such a way that both axes are parallel to the sides of the rectangle. The angle of this rotation with respect to the x-axis would be $\phi$.
Now we can convert the points in the initial plane to the adjusted plane using the equations.
$x' = x\cos(\phi) + y\sin(\phi)$
$y' = y\cos(\phi) - x\sin(\phi)$
Now, it would become a straightforward integration of a rectangle aligned with the axis.
However, suppose the surface function is defined by $P(x, y)$. We need to pass the input so that the aligned plane values can be mapped to the initial one.
$I = \int_{y'_a}^{y'_b}\int_{x'_a}^{x'_c}P(x'\cos(\phi)-y'\sin(\phi), x'\sin(\phi) + y'\cos(\phi))dx'dy'$