How to build a trapezoid

1.3k Views Asked by At

Build a trapezoid knowing its diagonals, the angle between them, and, also, the sum of $2$ adiacent sides.

I appreciate your time and help!

3

There are 3 best solutions below

3
On BEST ANSWER

Given the lengths $\ell_1, \ell_2$ of two diagonals and the angle $\alpha$ between them, let $2a$ be the required sum of lengths of two adjacent sides.

  1. Construct three helper points $A, B, C$ such that $AB = \ell_1, AC = \ell_2$ and $\measuredangle BAC = \alpha$.
    ($AB$ and $AC$ are the two blue line segments in diagram below)
  2. Construct an ellipse having $A, B$ as foci with semi-major axis $a$.
    (The red ellipse in diagram below)
  3. Start from the two line segments $AB$ and $AC$, construct parallelogram $ABEC$ and let the line $AE$ intersect the ellipse at $F$.
  4. Start from the line segments $AC$ and $CF$, construct parallelogram $AGFC$.

Take $AB$ and $GF$ as the two desired diagonal. The quadrilateral $AGBF$ will be a trapezoid one seek. To see this.

  • By construction, $|AB| = \ell_1$. Since $AGFC$ is a parallelogram, $|GF| = |AC| = \ell_2$ and angle between $AB$ and $GF$ is the angle $\measuredangle BAC = \alpha$.
  • Since $F$ lies on the ellipse having $A$, $B$ as foci. $|AF| + |BF| = 2a$.
  • Since $ABEC$ and $AGFC$ are parallelograms, $GBEF$ is a parallelogram too. As a result, $GB \parallel FE \parallel AF$.

Trapezoid

1
On

My suggestion is to use a numerical optimization technique (such as fmincon in Matlab or the solver in Excel, i.e. techniques such as Nelder-Mead optimization etc) as follows:

Let's define some variables:

$L_{1}$ and $L_{2}$ are the lengths of the diagonals. $k$ is the sum of the 2 adjacent sides. $(x,y)$ is the coordinate vector of the corner between the two adjacent sides. $\alpha$ is the angle between the diagonals (which will be the angle of the second diagonal with the x-axis in the anticlockwise, i.e. negative, direction)

Start with one of the diagonals placed on the x-axis. This diagonal is now the vector $(L_{1},0)$. I will refer to this as the base diagonal. What we are going to do is construct a triangle using this vector as the bottom line of the triangle by randomly choosing the third point to be $(x,y)$ subject to the constraint that the two sides sum to $k$. Once we have chosen this point, using the length and angle of diagonal information we can construct only one quadrilateral. We can then define a error as the angle between two opposite sides (as they must be parallel to form a trapezoid) which we can run through an optimization algorithm to solve for 0.

enter image description here

So we have some constraints for $(x,y)$:

The adjacent sides must sum to $k$. The first side is simply the vector $(x,y)$. The second is the line form $(x,y)$ to $(L_{1},0)$. So this gives us the constraint

$\sqrt{x^2 + y^2} + \sqrt{(L_{1} - x)^2 + y^2} = k$

The angle between the two diagonals for also creates constraints. Think of the diagonals intersecting at either end of our base diagonal, i.e. the red dashed lines in the figure. $(x,y)$ must fall between these two lines. For example the left hand boundary means that the angle of $(x,y)$ must be smaller than $180^\circ - \alpha$ or $\tan(y/x) \le \pi-\alpha$. I'll leave the other constraint for you. The fourth and final constraint is that $x$ must be strictly positive.

Next we need to find our error ($\epsilon^2$):

This is the angle between the two sides we want to be parallel. I'm going to make these the side opposite the origin, i.e. the line from $(x,y)$ to $(L_{1},0)$, and then the side starting at $(0,0)$ and ending at the fourth corner which we will call $(x_{1}, y_{1})$. To find this angle we can take a dot product of the two lines i.e.

$\cos{\epsilon}=(x-L_{1},y)\cdot(x_{1},y_{1})$

So in order to solve for $\epsilon$ we need first to find $(x_{1},y_{1})$. To do this we need to construct the second diagonal which we know goes from $(x,y)$ to $(x_{1},y_{1})$, has a length $L_{2}$ and an angle of $-\alpha$. By taking dot products again, I get that

$\cos{\alpha}=\dfrac{(x_{1}-x,y_{1}-y)\cdot(L,0)}{L_{1}\times L_{2}}$

$\therefore x_{1}=x+L_{2}\cos{\alpha}$.

We can find $y_{1}$ now because $(x_{1}-x)^2+(y_{1}-y)^2=L_{2}^2$

Thus we can solve for $\epsilon^2$.

This is now everything we need to feed to a Nealder-Mead or Levenberg-Marquardt type optimizer to find the $(x,y)$ that will make the two sides parallel and thus find a trapezoid subject to all your conditions.

2
On

Problem

Given $x+y$, $d_1$, $d_2$ and $\alpha$, construct trapezoid $ABCD$ as sketched in Fig.1.

enter image description here

Solution

See Fig.2.

  1. Mark an arbitrary point $A$

  2. From $A$ draw an arbitrary ray $r$

  3. Mark a point $C$ on r, such that $AC=d_1$

  4. From $C$ draw a ray $s$, such that the measure of the angle between $r$ and $s$ is $\alpha$

  5. Mark $E$ on $s$, such that $CE = d_2$

  6. Draw the line segment $AE$

  7. Draw a line $t$ $(t \parallel AE)$ such that $C \in t$

  8. Mark $A'$ on $t$ such that $A'C = x+y$

  9. Draw the perpendicular bisector $u$ of $AA'$(*)

  10. Mark point $B$, such that $B=u \cap t$

  11. Mark point $D$ on $AE$ such that $BD =d_2$

(*) Note in Fig.1 that $AB=A'B$, hence B is a point of the perpendicular bisector of $AA'$