Find the angle {\color{orange}\alpha}
with
- \dfrac \pi 2 \leq {\color{orange}\alpha} \leq \dfrac \pi 2
, s.t. the equation
\sin \left({\color{orange}\alpha}\right) + \cos \left({\color{orange}\alpha}\right) =
\dfrac{\sqrt{W}}{2}
holds.
\color{orange}\alpha
=
pow(-1,N+1) + " * \\frac{\\pi}{12}"
We divide the equation by {\color{blue}\sqrt 2}
:
{\color{blue}\dfrac 1{\sqrt 2}} \sin \left({\color{orange}\alpha}\right) +
{\color{blue}\dfrac 1{\sqrt 2}} \cos \left({\color{orange}\alpha}\right)
= \dfrac{\sqrt{W/2}}{2}
.
In the table with known values of the sine and cosine functions
\begin{array}{c|c c c c c} x & 0 & \frac{\pi}{6} & \frac{\pi}{4} & \frac{\pi}{3} & \frac{\pi}{2} \\ \hline \sin(x) & 0 & \frac{1}{2} & \frac{\sqrt{2}}{2} & \frac{\sqrt{3}}{2} & 1 \\ \cos (x) & 1 & \frac{\sqrt{3}}{2} & \frac{\sqrt{2}}{2} & \frac{1}{2} & 0 \end{array}
we see tht
{\color{blue}\dfrac 1{\sqrt 2} = \dfrac {\sqrt 2}2 =
\sin \left( \dfrac \pi 4\right) = \cos \left( \dfrac \pi 4\right).}
We substitute this above, to get
{\color{blue} \cos \left( \dfrac \pi 4\right)} \sin \left({\color{orange}\alpha}\right) +
{\color{blue}\sin \left( \dfrac \pi 4\right)} \cos \left({\color{orange}\alpha}\right)
= \dfrac{\sqrt{W/2}}{2}
.
The addition theorem for the angles {\color{blue}\beta = \dfrac \pi 4}
and {\color{orange}\alpha}
allows to simplify of the equation, giving:
\sin \left ( \dfrac \pi 4 + {\color{orange}\alpha}\right) =
\dfrac{\sqrt{W/2}}{2}
.
The restriction - \dfrac \pi 2 \leq {\color{orange}\alpha} \leq \dfrac \pi 2
and using once more the values in the table above
show
\dfrac \pi 4 + {\color{orange}\alpha} = \dfrac{\pi}{6/(N+1)} \implies {\color{orange}\alpha} =
\dfrac{2*N-1}{12}\pi
.