4

I know the lengths of the four sides of a quadrilateral and the difference between the diagonals (but I do not know the actual lengths of the diagonals). My instinct is that this information ought to be sufficient to determine the angles of the quadrilateral, because a specific difference between the diagonals constrains it to a single, fixed shape.

example measurements: L side length = 326mm; R side length = 325mm; bottom length = 677mm; top length = 675mm; diagonal from bottom L to top R is 7mm longer than from bottom R to top L

Dave R
  • 41
  • 1
  • 1
    I think you should prove first that your chosen measurements can actually form a quadrilateral. – Napoleon Bonaparte Feb 23 '24 at 19:28
  • Assuming you fix the points $A$ and $B$, then you have four unknowns which are the coordinates of $C$ and $D$. From the side length information you add three quadratic equations right away. And the fourth one comes from the difference of the two diagonals. So you should be able to solve for the unknowns. The solution may be only numeric , not analytic. – Hosam Hajeer Feb 23 '24 at 20:48

4 Answers4

2

Let's call the vertices of the quadrilateral $A,B,C,D$ in counter clockwise direction. Let $a = AB , b = BC, c = CD , d = DA $. We can can let $A = (0,0)$ on the cartesian plane, and $B = (a, 0) $. Further, let $C = (x_1, y_1) $ and $D = (x_2, y_2)$. Now we have

$ b^2 = (x_1 - a)^2 + y_1^2 $

$ c^2 = (x_1 - x_2)^2 + (y_1 - y_2)^2$

$ d^2 = x_2^2 + y_2^2$

And if $e = AC - BD$ , then

$ e = \sqrt{ x_1^2 + y_1^2 } - \sqrt{ (x_2 - a)^2 + y_2^2 } $

we now have

$ x_1^2 + y_1^2 = b^2 - a^2 + 2 a x_1$

$ (x_2 - a)^2 + y_2^2 = d^2 + a^2 - 2 a x_2 $

Hence,

$ e = \sqrt{ b^2 - a^2 + 2 a x_1 } - \sqrt{ d^2 + a^2 - 2 a x_2 } $

Squaring,

$ e^2 = b^2 + d^2 + 2 a (x_1 - x_2) - 2 \sqrt{ (b^2 - a^2 + 2 a x_1)(d^2 + a^2 - 2 a x_2 ) } $

So that

$ \bigg( e^2 - b^2 - d^2 - 2 a (x_1 - x_2) \bigg)^2 = 4 \bigg(b^2 - a^2 + 2 a x_1\bigg) \bigg(d^2 + a^2 - 2 a x_2 \bigg)$

So now we have four quadratic equations in $4$ unknowns $x_1,y_1, x_2, y_2$.

The actual dimension of the problem can be reduced to $2$ utilizing equations (1) and (3), which are equations of circles centered at $(a, 0)$ and $(0,0)$ respectively.

Specifically, we have two parameters, $\theta$ and $\phi$, and we have $ x_1, y_1, x_2, y_2$ defined in terms of them as follows:

$ x_1 = a + b \cos \theta $

$ y_1 = b \sin \theta $

$ x_2 = d \cos \phi $

$ y_2 = d \sin \phi $

With this we have eliminated equations (1) and (3). Now the second equation becomes

$ c^2 = ( a + b \cos \theta - d \cos \phi)^2 + ( b \sin \theta - d \sin \phi)^2 $

And the last equation becomes

$ \bigg( e^2 - b^2 - d^2 - 2 a (a+b \cos\theta - d \cos \phi) \bigg)^2 \\= 4 \bigg(b^2 - a^2 + 2 a (a + b \cos \theta)\bigg) \bigg(d^2 + a^2 - 2 a d \cos \phi \bigg)$

These two equations in $\theta$ and $\phi$ can be solved numerically via the Newton-Raphson (multivariate) method.

And that's what I have done. I implemented the Newton-Raphson method for the specific two equations above. With $a= 7, b = 4, c = 3, d = 5, e = 1 $, I got the following two solutions. Note that in the second solution, the order of subtraction of the diagonals is reversed, in other words, the program finds solutions such that the difference of the diagonals in absolute value is $e$.

Quad 1

Quad 2

The program listing follows. It is written in Microsoft Excel VBA (Visual Basic for Applications).

Public Sub quadrilateral_()
Dim x(2), y(2), jac(2, 3) As Double
Dim a, b, c, d, e As Double
Dim sol_mat(160, 2) As Double
Dim vers(5, 2) As Double

a = 7 b = 4 c = 3 d = 5

e = 1

For it1 = 0 To 59 t1 = it1 / 60 * (2 * p)

x(1) = t1

For it2 = 0 To 59 t2 = it2 / 60 * (2 * p)

x(2) = t2

success = 0

For ic = 1 To 30

Call find_y_quad(a, b, c, d, e, x, y)

If norm(y, 2) < 0.000001 Then

success = 1

For i = 1 To 2 x(i) = x(i) - 2 * p * Int(x(i) / (2 * p)) Next i

t = x(1) s = x(2)

vers(1, 1) = 0 vers(1, 2) = 0

vers(2, 1) = a vers(2, 2) = 0

vers(3, 1) = a + b * Cos(t) vers(3, 2) = b * Sin(t)

vers(4, 1) = d * Cos(s) vers(4, 2) = d * Sin(s)

vers(5, 1) = vers(1, 1) vers(5, 2) = vers(1, 2)

' make sure that quadrilateral is convex

For i = 2 To 4

j = i + 1

For k = 1 To 2 u1(k) = vers(i, k) - vers(i - 1, k) u2(k) = vers(i + 1, k) - vers(i, k) Next k

Call cross(u1, u2, u3)

If u3(3) < 0 Then GoTo lnext_it2

Next i

Call append_cmat(sol_mat, x)

Exit For

End If

Call find_jac_quad(a, b, c, d, e, x, jac)

For i = 1 To 2 jac(i, 3) = -y(i) Next i

Call reduce_matrix(jac, 2, 3, 0.00000001, det)

If Abs(det) < 0.000001 Then MsgBox ("jac not invertible") Exit Sub End If

For i = 1 To 2 x(i) = x(i) + jac(i, 3) Next i

Next ic

If success = 0 Then 'MsgBox ("did not converge") Exit Sub End If

' MsgBox ("converged in " + Str(ic - 1) + " iterations")

lnext_it2: Next it2

Next it1

MsgBox ("total no. of solutions found = " + Str(sol_mat(0, 0)))

k1 = 10

For i = 1 To sol_mat(0, 0)

For j = 1 To 2 ActiveSheet.Cells(i, j) = sol_mat(i, j) Next j

t = sol_mat(i, 1) s = sol_mat(i, 2)

vers(1, 1) = 0 vers(1, 2) = 0

vers(2, 1) = a vers(2, 2) = 0

vers(3, 1) = a + b * Cos(t) vers(3, 2) = b * Sin(t)

vers(4, 1) = d * Cos(s) vers(4, 2) = d * Sin(s)

vers(5, 1) = vers(1, 1) vers(5, 2) = vers(1, 2)

k = k1 narcs = 0 ipass = 2

Call draw_points(2, 1, 5, vers, 1) Call draw_points(0, 1, 4, vers, 3)

k2 = k

If i = 1 Then

Call plot_curve(0, k1, 0, 0, 0, &quot;&quot;, &quot;&quot;)

Else

Call plot_curve(1, k1, 0, 0, 0, &quot;&quot;, &quot;&quot;)

End If

k1 = k2

Next i

End Sub


Public Sub find_y_quad(a, b, c, d, e, x, y)
Dim lhs, rhs As Double

t = x(1) s = x(2)

y(1) = (a + b * Cos(t) - d * Cos(s)) ^ 2 + (b * Sin(t) - d * Sin(s)) ^ 2 - c ^ 2

lhs = (e ^ 2 - b ^ 2 - d ^ 2 - 2 * a * (a + b * Cos(t) - d * Cos(s))) ^ 2 rhs = 4 * (b ^ 2 - a ^ 2 + 2 * a * (a + b * Cos(t))) * (d ^ 2 + a ^ 2 - 2 * a * d * Cos(s))

y(2) = lhs - rhs

End Sub


Public Sub find_jac_quad(a, b, c, d, e, x, jac)

Dim y(2), y1(2), u(2) As Double

Call find_y_quad(a, b, c, d, e, x, y)

For j = 1 To 2

For i = 1 To 2 u(i) = x(i) Next i

u(j) = u(j) + 0.01

Call find_y_quad(a, b, c, d, e, u, y1)

For i = 1 To 2 jac(i, j) = 100 * (y1(i) - y(i)) Next i

Next j

End Sub


Public Sub append_cmat(cmat, c)
Dim i, j, n As Integer, ns As Integer

n = cmat(0, 0)

n = n + 1

For i = 1 To 2 cmat(n, i) = c(i) Next i

Call eliminate_duplicates_2d(n, 2, cmat, 0.000001, ns, cmat)

cmat(0, 0) = ns

End Sub


Hosam Hajeer
  • 21,978
  • Wow. Thanks, "of course"! As a non-mathemetician, I (sort of) followed your reasoning until I couldn't, but hopefully my brother (who was a math major many decades ago) will be able to help me decipher your generously extensive answer. – Dave R Feb 24 '24 at 00:10
  • @DaveR You're welcome. – Hosam Hajeer Feb 24 '24 at 13:18
1

Yes, it is possible because there are five unknowns, the four angles, $\alpha, \beta,\gamma,\delta$ and one of the diagonals $D_1,D_2$ because $|D_1-D_2|=L$ where $L$ is data. But we have five equations.

Suppose $D_1\lt D_2$ so $D_2=D_1+L$, our five equations are $$D_1^2=a^2+d^2-2ad\cos(\alpha)\\D_1^2=b^2+c^2-2bc\cos( \gamma)\\(D_1+L)^2=a^2+b^2-2ab\cos( \beta)\\(D_1+L)^2=c^2+d^2-2cd\cos (\delta)\\\alpha+\beta+\gamma+\delta=2\pi$$

Piquito
  • 29,594
1

I'll add another answer just to show how this can be reduced to the solution of a single algebraic equation. Let's call $a = AB$, $b = BC$, $c = CD$, $d = DA$ the given sides of the quadrilateral and $y=BD$, $y+l=AC$ its unknown diagonals (but $l$ is given) .

From the cosine law we get: $$ \cos\angle ADB={y^2+d^2-a^2\over2dy}, \quad \cos\angle CDB={y^2+c^2-b^2\over2cy}. $$ Hence, using the cosine addition formula: $$ \begin{align} \cos\angle ADC= &\ \cos\angle ADB\cos\angle CDB-\sin\angle ADB\sin\angle CDB\\ =&\ {y^2+d^2-a^2\over2dy}\cdot{y^2+c^2-b^2\over2cy}- \sqrt{1-{(y^2+d^2-a^2)^2\over(2dy)^2}} \sqrt{1-{(y^2+c^2-b^2)^2\over(2cy)^2}} \end{align} $$ and finally, from the cosine rule: $$ (y+l)^2=c^2+d^2-2cd \left({y^2+d^2-a^2\over2dy}\cdot{y^2+c^2-b^2\over2cy}- \sqrt{1-{(y^2+d^2-a^2)^2\over(2dy)^2}} \sqrt{1-{(y^2+c^2-b^2)^2\over(2cy)^2}}\right), $$ which is an equation in the unkown $y$. We can rearrange terms and square both sides, to eliminate roots and denominators. The final result is a sixth degree equation: $$ 2 y^6+6 l y^5 -\left(a^2+b^2+c^2+d^2-7 l^2\right)y^4 -2\left(a^2 + b^2 + c^2 + d^2 -2 l^2\right)l y^3 +\left(a^2 b^2+b^2 c^2+c^2 d^2+d^2 a^2 -2 a^2 c^2-2 b^2 d^2 -(a^2 +b^2 +c^2 +d^2) l^2+l^4\right)y^2 \\ +2\left(a^2 b^2 - a^2 c^2 - b^2 d^2 + c^2 d^2 \right) l y \\ +a^4 c^2+a^2 c^4+b^4 d^2+b^2 d^4 -a^2 b^2 c^2-a^2 b^2 d^2-a^2 c^2 d^2-b^2 c^2 d^2\\ +(c^2 d^2 +a^2 b^2-a^2 c^2-b^2 d^2) l^2 =0. $$ Inserting here, for instance, the data given in the question: $$ a = 677,\quad b = 325,\quad c = 675,\quad d = 326,\quad l = 7, $$ we obtain only two positive solutions: $y\approx746.775$ and $y\approx588.986$, the second one corresponding to a self-intersecting quadrilateral.

Intelligenti pauca
  • 50,470
  • 4
  • 42
  • 77
1

If it is not required that the quadrilateral be convex, then in some cases the lengths of the four sides and the difference between the diagonals are insufficient to constrain the quadrilateral to a single, fixed shape.

To illustrate this, suppose we are given $AB = DA = 5$, $BC = CD = 3$ and $BD - AC = 1$. Consider the diagram below where $B,C,D$ are in line yielding a quadrilateral consisting of two $3-4-5$ triangles:

enter image description here

Obviously this does not meet the requirements since $BD-AC=2$. Now imagine $C$ moved gradually to the right while holding point $A$ and lengths $AB,BC,CD,DA$ fixed, so that $B$ and $D$ are pulled towards each other. Initially $BD=6$ and $AC=4$. Eventually, when $B$ and $D$ coincide, $BD=0$ and $AC=5+3=8$ so $BD-AC$ has reduced continuously from $2$ to $-8$. There must be an intermediate point with $C$ to the right of $BD$ at which $BD-AC=1$.

Note that the argument does not depend on an assumption that $BD$ and $AC$ change at the same rate or pro rata (such an assumption would be incorrect).

Now imagine, with the same conditions, $C$ moved gradually to the left until $B$ and $D$ coincide. In this case $BD$ falls continuously from $6$ to $0$ and $AC$ from $4$ to $5-3=2$, so $BD-AC$ falls from $2$ to $-2$. Again, there must be an intermediate point at which $BD-AC=1$ with in this case $C$ to the left of $BD$.

So there exist two distinct quadrilaterals, one convex and one non-convex, meeting the given requirements.

Adam Bailey
  • 4,197