
Four sides of an irregular quadrilateral can be arranged in convex, concave or crossed shape.

We assume that the vertices are connected sequentially from A to B, then to C, to D, and finally back to A. Because any arbitrary set of four sides can form a convex, concave, or crossed quadrilateral, it is necessary to define the exact configuration.
To draw a closed quadrilateral, the following inequalities must be satisfied:

Any quadrilateral shape can be divided into 2 triangles.
The area of a convex quadrilateral can be expressed in one of the following formulas:


Area of concave quadrilateral
By applying Cosine Law on triangle ABD, we find diagonal q:



It should also be noted that triangles BCD and BDE are congruent (all sides are the same). This implies that the same geometric configuration of the quadrilateral can be convex, and in certain cases may also become concave, depending on the folding direction and angle relationships.




If the coordinates of the vertices of a quadrilateral are known, then the sides can be presented as vectors. If the directions of the sides vectors are as shown in the figure, then their values are found as follows:

notice that the addition of the vectors of a closed shape is 0. v1 + v2 + v3 + v4 = 0.
The area of a quadrilateral equals one half of the sum of the absolute magnitudes of the cross products of each pair of opposite side vectors.

Clarification notes: In 3D, the cross product of two vectors produces a vector that is perpendicular to both input vectors. However, in our case, we are dealing with the cross product of 2D vectors. In 2D, the cross product is not a vector but a scalar value. This scalar absolute value represents the signed area of the parallelogram formed by the two 2D vectors.
After evaluating the cross product, we obtain a simpler expression for the area. Note that each determinant should be taken as a positive value, even if its computed result is negative. (See example 1)

![A_area=1/2 [(x_1-x_4 )(y_2-y_1 )-(x_2-x_1 )(y_1-y_4 )+(x_3-x_2 )(y_4-y_3 )-(x_4-x_3 )(y_3-y_2 )]](/TrigoCalc/Quadrilateral/Eq/eq1b1.png)
Further develop this equation we get the Shoelace Formula (also known as Gauss's Area Formula).




Quadrilateral midpoints − Varignon’s theorem

Example 1 - inputs 4 sides and an angle.


Once q is known, angle γ can be found by cos law.








The area can be calculated by different methods; we will simply add the areas of the two triangles.


Until now, we have treated the quadrilateral as convex. We now examine whether the same quadrilateral can also be concave. Since the angle α is known, concavity can occur only along the diagonal BD (diagonal q). Therefore, two conditions must be checked:
From cosine low angles δ and angle δ can be found:


Because β1 > β2 and δ1 > δ2. triangle BCD is folded onto triangle ABD, and the quadrilateral can be concave along diagonal q (as shown in figure 2).

The diagonal q is equal according to Cosine Law to:

Angle ∡ABD can be found by Sinus Law

Central angle ∡BCD from cosine law is equal to







Example 5 - Area of vertices coordinates.


Vactor (AB) = (−2 − 0)i + (3 − 2) j = −2i + j
Vactor (AD) = (3 − 0)i + (4 − 2) j = 3i + 2j
Vactor (p) = (−1 − 0)i + (5 − 2) j = −i + 3j



vector (q) = (−2 − 3)i + (3 − 4)j = −5i − j

