Angles of two connected convex quadrilaterals, all lengths given Consider two convex quadrilaterals sharing one edge with lines meeting at the endpoints of this edge being collinear, so that the seven edges form another, larger convex quadrilateral (see picture).
With all lengths but no angles given, these quadrilaterals are still perfectly defined.
Now I want to calculate the angles for given lengths $a$ to $g$ (any angle, from there I can calculate the others)

If you can help me, it's greatly appreciated! It's for a mechanism I want to build :)
 A: 
Hint:  Extend the side containing $e,d$ and the side containing $a, b$.  Mark their intersection.  From the law of cosines
$ x^2 + y^2 - 2 K x y = c^2 $
$ (x+d)^2 + (y + b)^2 - 2 K (x + d)(y + b) = g^2 $
$ (x + d + e)^2 + (y + a + b)^2 - 2 K (x + d + e)(y + a + b) = f^2 $
where $K = \cos(\theta) $
These equations can be solved numerically quite easily.  For example, using the well-known multi-variate Newton-Raphson method, which is well-suited to this particular problem, because the Jacobian is straight forward to compute.
Once $x, y, \cos(\theta)$ are available, the result of the angles in the composite figure can be computed using a combination of the law of sines and the law of cosines.
A: 
Here's another approach.  Let $\alpha, \beta, \gamma$ be the angles indicated in the above diagram.  Then, using the distances $e, d$ we can write the following three equations.
$ e^2 = ( (- g \cos(\beta) + a - f \cos(\alpha) )^2 + (f \sin(\alpha) - g \sin(\beta) )^2 $
$ d^2 = ( (- c \cos(\gamma) + b + g \cos(\beta) )^2 + (g \sin(\beta) - c \sin(\gamma) )^2 $
$ (e + d)^2 = (a + b - f \cos(\alpha) - c \cos(\gamma) )^2 + (f \sin(\alpha) - c \sin(\gamma) )^2$
And these equations can be solved numerically for $\alpha, \beta, \gamma$.
To solve, define the unknowns
$x_1 = \cos(\alpha), x_2 = \sin(\alpha)$
$x_3 = \cos(\beta), x_4 = \sin(\beta)$
$x_5 = \cos(\gamma), x_6 = \sin(\gamma)$
Then the above equations become
$ e^2 = a^2 + g^2 + f^2 + 2 g f (x_1 x_3 - x_2 x_4) - 2 a g x_3 - 2 a f  x_1 $
$ d^2 = b^2 + c^2 + g^2 + 2 c g (-x_3 x_5 -x_4 x_6 ) - 2 b c x_5 - 2 g b x_3 $
$(e + d)^2 = (a + b)^2 + f^2 + c^2 + 2 f c (x_1 x_5 - x_2 x_6 ) - 2 f(a + b) x_1 - 2 c (a + b) x_5 $
In addition, we have the following three equations:
$ x_1^2 + x_2^2 = 1$
$ x_3^2 + x_4^2 = 1$
$x_5^2 + x_6^2 = 1 $
So, now have a quadratic system of dimension $6$, which can solved iteratively using the standard multi-variate Newton-Raphson method.  This numerical method is known to converge to a solution very quickly, especially if it is initialized with a good initial guess of the solution.
A: In fact, the whole issue can be characterized by 2 angular parameters $\alpha$ and $\beta$.
Let us take for that the common line segment (with length $g$) as the $x$ axis centered in the midpoint of this segment with the following notations:

Fig. 1: A solution.
Question: $a,b,c,d,e,f,g,h$ being given, is it possible to have a configuration like the one of fig. 1 ?
Such a configuration is possible iff there exist angles $\alpha$ and $\beta$ such that
$$\begin{cases}
C&=&(\ \ \ \frac12g+e \cos(\beta),& \ \ \ e \sin\beta)\\
D&=&(-\frac12g+a \cos(\alpha),& \ \ \ a\sin\alpha)\\
E&=&(-\frac12g-b \cos(\alpha),&-b \sin\alpha)\\
F&=&(\ \ \ \frac12g-d \cos(\beta),&-d \sin\beta)
\end{cases}$$
Constraining $EF=c$ and $CD=f$ gives the following two equations with variables $\alpha$ and $\beta$:
$$\begin{cases}
(g+b \cos(\alpha)-d \cos(\beta))^2+(b \sin \alpha -d \sin \beta)^2&=&c^2\\
(g+e \cos(\beta)-a \cos(\alpha))^2+(e \sin \beta -a \sin \alpha)^2&=&f^2
\end{cases}\tag{2}$$
For given values of parameters $a,b,...g$, the visualization of the curves associated with equations (2) (where the unknowns are $\alpha$ and $\beta$) provides an instant answer to the issue :

*

*if the curves do not intersect, it's finished.


*otherwise, the coordinates $(\alpha,\beta)$ of intersection point(s) in $[0,\pi]\times[0,\pi]$ allow at once a construction with $D,A,E$ and $F,B,C$ aligned. This can be done using an interactive software such as Geogebra (with which I have made the figures). For example with values
$$a=2.7, \ b=2.1, \ c=2.7, \ d=1.5, \ e=2.6, \ f=2.2, \ g=2.8$$
as it is the case of Fig. 2, there are no solutions, whereas in the case of Fig. 3 there are 2 solutions.

Fig. 2: A case where there are no solutions, i.e., there is no intersection between the curves with equations (2)(a) in blue an (2)(b) in orange in an $(\alpha, \beta)$ coordinate frame. Of course, the range should be restricted to $[0,\pi] \times [0,\pi]$ but having a larger scope is interesting also...

Fig. 3: A case with 2 pairs of solutions $(\alpha, \beta) \in [0,\pi] \times [0,\pi]$ with its Geogebra coding.
