If $\cos A+\cos B=p$ and $\sin A+\sin B=q$, then find $\cos\left( \frac {A+B}{2}\right)$ in terms of $p$ and $q$ If $\cos A+\cos B=p$ and $\sin A+\sin B=q$ then find $\cos \left( \dfrac {A+B}{2}\right)$ in terms of $p$ and $q$. 
My Attempt:
$$\cos A+\cos B=p$$
$$2\cos \left( \dfrac {A+B}{2}\right)\cos \left( \dfrac {A-B}{2}\right)=p$$
And,
$$\sin A+ \sin B=q$$
$$2\sin \left( \dfrac {A+B}{2} \right)\cos \left( \dfrac {A-B}{2} \right)=q$$
Now,
$$\tan \left( \dfrac {A+B}{2}\right)=\dfrac {q}{p}$$.
How do I proceed further?
 A: Let, $\dfrac{A+B}{2}=x\implies\tan x=\dfrac{q}{p}=\dfrac{\text{height}}{\text{base}}$.
Now suppose for a right angle triangle the height is $aq$ units and base is $ap$ units $(a\neq0)$. So the length of hypotenuse is $=a\sqrt{q^2+p^2}$ units.
$\cos x=\dfrac{\text{base}}{\text{hypotenuse}}=\dfrac{ap}{a\sqrt{q^2+p^2}}=\dfrac{p}{\sqrt{q^2+p^2}}$.
$\implies\cos\left(\dfrac{A+B}{2}\right)=\dfrac{p}{\sqrt{q^2+p^2}}$.
A: here is a geometric interpretation of your work: think of the points $(\cos A, \sin A)$ and $(\cos B , \sin B)$ as two points also called $A$ and $B$ on the unit circle. the arc length is measured from the initial point $O = (1,0).$ now,
the mid point of the chord $AB$ has the coordinate $(p/2, q/2).$ we push this point onto the midpoint of the arc $(A+B)/2$ by dividing by its length to get the cordinates  $$\left(\frac p{\sqrt{p^2 + q^2}}, \frac q{\sqrt{p^2+q^2}}\right).$$
the $x$-coordinate $\frac p{\sqrt{p^2 + q^2}}$ is $\cos((A+B)/2).$
A: One can also get at this via complex variables / Euler's formula without too much trouble. Combining real $p,q$ into a single complex quantity, we have 
\begin{align}
p+i q&=(\cos A+\cos B)+i(\sin A +\sin B)\\&=(\cos A+i\sin A)+(\cos B+i\sin B)\\&=e^{iA}+e^{iB}.\end{align} If we complex-conjugate both sides, then this becomes $$p-i q=e^{-iA}+e^{-i B}=e^{-iA}e^{-iB}(e^{iB}+e^{iA})=e^{-i(A+B)}(p+i q).$$ From this we have $$|p+iq|^2=(p+iq)(p-iq)=e^{-i (A+B)}(p+iq)^2\implies e^{i(A+B)}=\frac{(p+iq)^2}{|p+i q|^2} $$ and therefore $$e^{i(A+B)/2}=\cos\frac{A+B}{2}+i\sin \frac{A+B}{2}=\frac{p+i q}{|p+i q|}=\frac{p+i q}{\sqrt{p+i q}}.$$
Identifying the real parts gives the desired cosine.
