I know that a first-order linear constant coefficient PDE, such as $au_x + bu_y = 0$, can be transformed to an ODE by rotating the coordinate system so the $x'$ axis points to $(a,b)$ where the directional derivative vanishes.
As far as I know, a coordinate rotation is done by $x' = xcos\theta + y sin\theta$ and $y' = y' cos\theta - x' sin\theta$
However, in basic PDE textbooks this is done via:
$x' = ax + by$ and $y' = bx - ay$
My problem is that I do not understand how did we get this formulas. Although I guess that it should be quite simple, for example I know that the vector $(b,-a)$ is the orthogonal to $(a,b)$ and it should have a relationship with the problem, I do not get it.