Angles of two connected convex quadrilaterals, all lengths given

210 Views Asked by At

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)

Two connected convex quadrilaterals

If you can help me, it's greatly appreciated! It's for a mechanism I want to build :)

4

There are 4 best solutions below

6
On

enter image description here

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.

2
On

enter image description here

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.

3
On

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:

enter image description here

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.

enter image description here

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...

enter image description here

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

0
On

Define $x, y, \theta$ as in Grab a coffee's answer. Change variable to $(u,v,K) = (x+d,y+b,\cos\theta)$. Let

  • $\tau = \begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix}$, $\omega = \begin{bmatrix}0 & -1\\ 1 & 0\end{bmatrix}$ and $\Lambda = \begin{bmatrix}1 & -K\\ -K & 1\end{bmatrix}= I_2 - K\tau$.
  • $p = \begin{bmatrix}u \\ v\end{bmatrix}$, $q_1 = \begin{bmatrix}e \\ a\end{bmatrix}$, $q_2 = \begin{bmatrix}d \\ b\end{bmatrix}$ and $r_1 = f$, $r_2 = c$.

In the following discussion, we will assume $\gamma \stackrel{def}{=} q_1^T \omega q_2 = ad-be \ne 0$.

In terms of these, the cosines rules becomes: $$\left\{\begin{array}{lcl} p^T \Lambda p &=& g^2\\ (p+q_1)^T \Lambda (p+q_1) &=& r_1^2\\ (p-q_2)^T \Lambda (p-q_2) &=& r_2^2 \end{array}\right. \quad\implies\quad \left\{ \begin{array}{lcr} 2q_1^T\Lambda p &=& \delta_1\\ 2q_2^T\Lambda p &=& -\delta_2 \end{array} \right. $$ where $$\delta_k = r_k^2 - q_k^T\Lambda q_k - g^2 = \underbrace{(r_k^2 - |q_k|^2 - g^2)}_{\alpha_k} + K \underbrace{q_k^T\tau q_k}_{\beta_k}\quad\text{ for }\quad k = 1,2 $$ Please note that the coefficients $\alpha_k$, $\beta_k$ above are indendent of $u,v$ and $K$.

Under assumption $\gamma \ne 0$, the two equations on the left are independent. We can solve them to get

$$\Lambda p = \frac{1}{2\gamma}\omega(\delta_1 q_2 + \delta_2 q_1)$$ Plug this into $1^{st}$ equation on the left, we get

$$g^2 = p^T\Lambda p = (\Lambda p)^T \Lambda^{-1}(\Lambda p) = \frac{1}{4\gamma^2} (\delta_1 q_2 + \delta_2 q_1)\omega^T\Lambda^{-1}\omega(\delta_1 q_2 + \delta_2 q_1)$$

Notice $\omega^T \omega = I_2$ and $\tau \omega = -\omega\tau$, we have $$\omega^T \Lambda^{-1} \omega = \frac{1}{1-K^2}\omega^T(I_2+K\tau)\omega = \frac{1}{1-K^2}\Lambda$$

This leads to $$(\delta_1 q_2 + \delta_2 q_1)^T\Lambda(\delta_1 q_2 + \delta_2 q_1) = 4g^2\gamma^2 (1 - K^2)$$ Define two more vectors $\alpha = \alpha_1 q_2 + \alpha_2 q_1$, $\beta = \beta_1 q_2 + \beta_2 q_1$, we can rewrite the equation as $$(\alpha + K\beta)^T(I_2 - K\tau)(\alpha+K\beta) - 4g^2\gamma^2(1-K^2) = 0\tag{*1}$$

In this final form, the vectors $\alpha, \beta$ and coefficient $\gamma$ can be computed directly from $a,b,c,d,e,f,g^{\color{blue}{[1]}}$. The LHS is a cubic polynomial in $K$.

Solve $K$ in any way you want (either analytically by Cardano's method or numerically by any 1-d root solver) and pick a $K$ within $(-1,1)$. You have $\theta = \cos^{-1}K$ and corresponding $u,v$ can be computed by the formula:

$$\begin{bmatrix}u \\ v\end{bmatrix} = \frac{1}{2\gamma}\Lambda^{-1}\omega(\delta_1 q_2 + \delta_2 q_1) = \frac{1}{2\gamma(1-K^2)}\omega(I_2 - K\tau)(\alpha + \beta K)$$

This will allow you to deduce all other angles in your figure.

As an example, take the case $(a, b, c, d, e, f, g) = (4,7,5,5,5,10,7)$.

The left quadrilateral is obtained from gluing a $4\times 3$ right triangle on top of a $4 \times 7$ rectangle. The right quadrilateral is obtained by gluing a $4 \times 3$ right triangle on top and $3 \times 4$ right triangle on right of a $4\times 4$ square. By construction, we will expect $K = \frac{4}{5}$.

If we compute $\alpha,\beta, \gamma$ and throw it into $(*1)$, we get

$$\begin{align} & -616000K^3+1507200K^2-1128000K+253184\\ = & -64(5K-4)(35K-43)(55K-23)\\ = & \phantom{-}0\end{align}$$

As expected, $\frac45$ is indeed a root of this.

BTW, there is another root, $\frac{23}{55}$, falls within $[-1,1]$. This is an artifact of the fact $b = g$ and $c = d$. The left quadrilateral degenerate to a triangle of sides $10,5,11$ while the right quadrilateral degenerate to a two line-segments bending at an angle (edge $b$ coincides with $g$, edge $c$ coincides with $d$).

In general, aside from constructing the quadrilaterals and test whether they are convex, there doesn't seem to be a way to decide which root of $K$ to pick.

Notes

  • $\color{blue}{[1]}$ For reference, $$\begin{align} \alpha &= \begin{bmatrix}d\,\left( -{g}^{2}+{f}^{2}-{e}^{2}-{a}^{2}\right) +e\,\left( -{g}^{2}-{d}^{2}+{c}^{2}-{b}^{2}\right) \cr b\,\left( -{g}^{2}+{f}^{2}-{e}^{2}-{a}^{2}\right) +a\,\left( -{g}^{2}-{d}^{2}+{c}^{2}-{b}^{2}\right) \end{bmatrix}\\ \beta &= \begin{bmatrix}2(a+b)de\\ 2(d+e)ab\end{bmatrix}\\ \gamma &= ad-be \end{align} $$