I need to plot a number of rectangles that are rotated at certain angles. For 'normal' rectangles, I would use a parametrization like:
$x = x_0 + \frac{1}{2}w \ sgn(\cos{\theta})$,
$y = y_0 + \frac{1}{2}w \ sgn(\sin{\theta})$, where $w$ is the width of the rectangle and $0\leq\theta\leq2\pi$
Can I use something similar where I can use the angle as input?
If you want to rotate the above by an angle $\psi$ then just apply the rotation to the $(x,y)$ coordinates
$$\begin{aligned} x &= x_0 + \tfrac{w}{2} \cos \psi\, {\rm sgn}(\cos \theta) - \tfrac{h}{2} \sin \psi\, {\rm sgn}(\sin \theta) \\ y &= y_0 + \tfrac{w}{2} \sin \psi\, {\rm sgn}(\cos \theta) + \tfrac{h}{2} \cos \psi\, {\rm sgn}(\sin \theta) \end{aligned} $$
where $w$ is the width and $h$ the height of the rectangle.