Vector calculations. How to get the new coordinates of an x,y point that is rotated 45 deg cw from centre? Although the logic of math is a fun challenge to work on, my years in math are far behind me. I therefore need help.
Context:
I am building a software to fly an underwater rectangular prizm like robot called an ROV. This requires me to control the 4 thrusters, which are located at each corner with a 45deg angle to the center.
I need to control these thrusters with a joystick.
The joystick gives us an x,y position that I need to program to apply thrust and direction on the right thruster.
Where I need help is on how to get the new coordinates of the joystick's x,y point that are rotated 45 deg cw from the axes' center. This will give me the actual amount of thrust to apply on each thrusters.
See my illustration bellow for a better understanding:

I think the answer lies in vectoring formulas.
Any help would be gratefully appreciated.
Regards,
E. 

Let's write $e_x$ and $e_y$ for the unit vectors in $x$ resp. $y$ direction, and $e_{x'}$, $e_{y'}$ for the unit vectors in the new directions. We have as we obtain $x$ from $x'$ by rotating in positive direction $45^°$, that 
$$ e_{x} = \cos(45^°)e_{x'} + \sin(45^°)e_{y'} = \frac 1{\sqrt 2}e_{x'}+ \frac 1{\sqrt 2}e_{y'} $$
Along the same lines
$$ e_{y} = -\frac 1{\sqrt 2} e_{x'} + \frac 1{\sqrt 2} e_{y'} $$
Now for the point $p = xe_x + ye_y$ we have
\begin{align*}
   p &= xe_x + ye_y\\
     &= \frac x{\sqrt 2}e_{x'} + \frac x{\sqrt 2}e_{y'} 
    - \frac y{\sqrt 2}e_{x'} + \frac y{\sqrt 2}e_{y'}\\
     &= \frac{x-y}{\sqrt 2} \cdot e_{x'} + \frac{x+y}{\sqrt 2} \cdot e_{y'}
\end{align*}
Hence, the point has $(x',y')$-coordinates $2^{-1/2}(x-y, x+y)$.
