Length of two sides in a quadrilateral with given angles I'm stuck finding the length of two sides in a quadrilateral for which I know all angles and the length of two sides.

All red objects are know ($a,b,\alpha,\beta,\gamma $  and $\delta$). I need to find the length of $c$ and $d$. I know it can't be too difficult but I can't figure it out atm. Thanks for your help!
 A: Here are the simple formulas giving $c$ and $d$ as functions of the known quantities:

$$\tag{1}\begin{cases}c=\tfrac{1}{sin(\gamma)}(a \sin(\delta)-b \sin(\alpha+\delta)) \ \ \ \ \ \ (i)\\ d=\tfrac{1}{sin(\gamma)}(b \sin(\beta) - a \sin(\alpha+\beta)) \ \ \ \ (ii)\end{cases}$$

Proof of formula (1(i)) (see figure below):
Let us give the names $A,B,C,D$ to the vertices associated with angles $\alpha, \beta, \gamma, \delta$ resp. 
Let us denote by $H$ the orthogonal projection of $B$ onto $CD$, by $I$ the orthogonal projection of $A$ onto $BH$, and by $J$ the orthogonal projection of $A$ onto line $DC$. In particular $AJHI$ is a rectangle. 
We are going to establish formula (1(i)) under the form:
$$\tag{2}\underbrace{c \sin(\gamma)}_{BH}=\underbrace{a \sin(\delta)}_{IH} \ \ \underbrace{-b \sin(\alpha+\delta)}_{BI}$$
As we have the identity $BH=BI+IH$, it remains to establish the three correspondences with line segments' length that are in (2).


*

*$BH=c \sin(\gamma)$ is clear by definition of a sine. 

*$IH=AJ=a \sin(\delta),$

*due to the fact that the sum of interior angles in quadrilateral $ADHB$ is $2\pi$, we have $\widehat{ABI}=\tfrac{3\pi}{2}-(\alpha +\beta)$; thus $BI=b \cos( \tfrac{3\pi}{2}-(\alpha +\delta)) \ = \ -b \ \sin(\alpha+\delta),$ ending the proof. 
Formula (1(ii)) does not need a specific proof, because, due to the symmetry of the figure, it suffices to exchange angles $\delta$ and $\beta$, and lengthes $a$ and $b$.
Remarks: 
1) the value of $\gamma$ can be obtained knowing $\alpha,\beta,\gamma$ by using relationship $\alpha+\beta+\gamma+\delta=2 \pi.$
2) $BH \perp JC$ could be interpretated as coordinates' axes.

A: Suppose our quadrilateral has vertices $A,B,C,D$. We can deduce the length of $BD$ using the law of cosines (Ignore the labels):

We get that
$$BD^2 = a^2 + b^2 - 2ab \cos \alpha$$.
Next, we find the angles $\angle ABD$ and $\angle ADB$ using law of sines to get:
$$m\angle ADB = \sin^{-1}\left(\frac{a \sin\alpha}{\sqrt{a^2+b^2-2ab\cos\alpha}}\right)$$
$$m\angle ABD = \sin^{-1}\left(\frac{b \sin\alpha}{\sqrt{a^2+b^2-2ab\cos\alpha}}\right)$$
Next, we deduce the measures of angles $\angle CBD$ and $\angle CDB$ using angle addition. We get
$$m\angle CBD = \beta-\sin^{-1}\left(\frac{a \sin\alpha}{\sqrt{a^2+b^2-2ab\cos\alpha}}\right)$$
$$m\angle CBD = \alpha-\sin^{-1}\left(\frac{b \sin\alpha}{\sqrt{a^2+b^2-2ab\cos\alpha}}\right)$$
Finally, use law of sines one last time to get:
$$c = \frac{\sin\left(\beta-\sin^{-1}\left(\frac{a \sin\alpha}{\sqrt{a^2+b^2-2ab\cos\alpha}}\right)\right) \sqrt{a^2+b^2-2ab\cos\alpha}}{\sin \gamma}$$
$$d = \frac{\sin\left(\alpha-\sin^{-1}\left(\frac{b \sin\alpha}{\sqrt{a^2+b^2-2ab\cos\alpha}}\right)\right) \sqrt{a^2+b^2-2ab\cos\alpha}}{\sin \gamma}$$
I may have made a mistake, someone please point it out if you find one. The general gist however, is the same. Law of cosines to find $BD$, law of sines to get the angles of triangle $BDC$, then law of sines again to get the measures of the sides of the triangle.
