☖ Home Units Converter Geometry Σ Math Physics Electricity

Irregular convex quadrilateral calculator

Print quadrilateral
Quadrilateral description

Quadrileteral coordinates
(xA, yA)
(
,
)
(xB, yB)
(
,
)
(xC, yC)
(
,
)
(xD, yD)
(
,
)
Side a    (DA)
Side b    (AB)
Side c    (BC)
Side d    (CD)
Angle α
Angle β
Angle γ
Angle δ
Diagonal AC (p)
Diagonal BD (q)
Angle between diagonals
Quadrilateral area
Quadrilateral perimeter
Area of triangle ABC
Area of triangle ACD
Area of triangle ABD
Area of triangle BCD
α1 
α2 
β1 
β2 
γ1 
γ2 
δ1 
δ2 
 
     
  
  
Input Limit:
Allowed inputs. At present, the following input configurations are supported:
1. The four side lengths and either one interior angle or one diagonal.
2. Any three of the following quantities: the quadrilateral’s area, its two diagonals, or the angle between the diagonals.
3. The cartesian vertices of the quadrilateral.
Irregular convex Quadrilateral summary
Concave area
Irregular convex quadrilateral summary
Print summary

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

Quadrilateral forms

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:

Quadrilateral
a + b + c > d
b + c + d > a
c + d + a > b
d + a + b > c

Any quadrilateral shape can be divided into 2 triangles.

The area of a convex quadrilateral can be expressed in one of the following formulas:

Quadrilateral area
Quadrilateral

Area of concave quadrilateral

If we have the values of angle α and the four sides a, b, c and d, then the area of the concave quadrilateral can be calculated using the following equations:

By applying Cosine Law on triangle ABD, we find diagonal q:

q^2=a^2+b^2-2ab cos⁡α

From triangle BCD
γ=cos^(-1)⁡((c^2+d^2-q^2)/2cd)
The area of the concave quadrilateral is obtained as the difference between the areas of triangles ABD and triangle BCD.
area=1/2 (ab sin⁡α-cd sin⁡γ )

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.

The diagonal p is found by the equations:
p=√(a^2+c^2-2ac cos⁡β )
Where β is equal to (see example 1):
β=sin^(-1)⁡((a sin⁡α)/q)-sin^(-1)⁡((d sin⁡γ)/q)
Quadrilateral drawing
As shown in Fig. 3, folding triangle BCD along the q-axis results in a concave quadrilateral. The question, then, is how to determine whether folding the triangle will produce a concave or a crossed shape. From Fig. 2, we observe that if both conditions β₁ > β₂ and δ₁ > δ₂ are satisfied, the resulting shape can also be concave. If only one of these conditions is satisfied, the resulting quadrilateral is crossed. Finally, if neither condition is satisfied, the shape is again concave; however, in this case triangle ABD is folded onto triangle BCD instead.
Area By Cross Product

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:

v_1=(x_2-x_1 )i+(y_2-y_1 )j v_2=(x_4-x_1 )i+(y_4-y_1 )j

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.

A=1/2 (|v_1×v_2 |+|v_3×v_4 |)

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_1-y_4@x_2-x_1&y_2-y_1 )|+1/2 |■(x_3-x_2&y_3-y_2@x_4-x_3&y_4-y_3 )|

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 )]

Further develop this equation we get the Shoelace Formula (also known as Gauss's Area Formula).

A_area=1/2 |(x_1 y_2+x_2 y_3+x_3 y_4+x_4 y_1 )-(x_2 y_1+x_3 y_2+x_4 y_3+x_1 y_4 )|

The area can also be expressed as one half of the absolute value of the cross product of the diagonal vectors, see example 5.
A_area=1/2 |p ̅×q ̅ |
Where:
p ̅=(x_2-x_4 )i+(y_2-y_4 )j
q ̅=(x_3-x_1 )i+(y_3-y_1 )j

Quadrilateral midpoints − Varignon’s theorem

Quadrilateral Mid Points
If we connects all the sides mid points of a quadrilateral we get a parallelogram no matter of the quadrilateral shape. The sides of the parallelogram are also parallel to the diagonals.

Example 1 - inputs 4 sides and an angle.

Print example 1
Find the area and the diagonals of a quadrilateral, if the four sides are: a = 10, b = 9, c = 7 and d = 6 and the angle between sides a and b is α and is equal to 65 degree. check if this quadrilateral can be convex and concave.

Concave solution

Exercise 1
Figure 1
First, we will find the value of diagonal  q by cos law:
q^2=a^2+b^2-2bc cosα
(1)
q=√(a^2+b^2-2ab cos⁡α ) q=√(10^2+9^2-2∙10∙9∙cos⁡65 )=10.24

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

q^2=c^2+d^2-2cd cos⁡γ
γ=cos^(-1)⁡((c^2+d^2-q^2)/2cd)
(2)

γ=cos^(-1)⁡((7^2+8^2-〖10.24〗^2)/(2∙7∙8))=cos^(-1)⁡〖(0.073)=85.9°〗

From triangle BCD after applying cos law we have:
d^2=c^2+q^2-2cq cos⁡〖β_1 〗

β_1=cos^(-1)⁡((c^2+q^2-d^2)/2cq)=cos^(-1)⁡((7^2+〖10.24〗^2-8^2)/(2∙7∙10.24))=cos^(-1)⁡0.63=51.2°

Angle β2 is found the same way from triangle ABD.
a^2=b^2+q^2-2bq cos⁡〖β_2 〗

β_2=cos^(-1)⁡((b^2+q^2-a^2)/2bq)=cos^(-1)⁡((9^2+〖10.24〗^2-10^2)/(2∙9∙10.24))=cos^(-1)⁡0.47=62.2°

And angle   β = β1 + β2 = 62.2 + 34.7 = 96.9 degree.
Now we can calculate diagonal q from triangle ABD:
p^2=b^2+c^2-2bc cos⁡β

p=√(b^2+c^2-2bc cos⁡β )=√(9^2+7^2-2∙9∙7 cos⁡113.4 )=13.42

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

area=∆ABD+∆BCD=1/2 ab sin⁡α+1/2 cd sin⁡γ

area=1/2 (10∙9 sin⁡〖65+〗 7∙8 sin⁡85.8 )=68.7
 

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:

if angle
β1 > β2 and angle δ1 > δ2
triangle ABD is folded onto triangle BCD
if angle
β1 < β2 and angle δ1 < δ2
triangle BCD is folded onto triangle ABD
In all other cases, the quadrilateral cannot form a concave shape.

From cosine low angles δ and angle δ can be found:

b^2=q^2+a^2-2qa cos⁡〖δ_1 〗
δ1 = 52.8 degree
c^2=q^2+d^2-2qd cos⁡〖δ_2 〗
δ2 = 41.6 degree

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

Exercise 1
Figure 2
Now we will find the area of the concave quadrilateral.

The diagonal q is equal according to Cosine Law to:

q=√(10^2+9^2-2∙10∙9∙cos⁡65 )=10.24

Angle ∡ABD can be found by Sinus Law

∡ABD=sin^(-1)⁡((a sin⁡α)/q)=62.3°

Central angle ∡BCD from cosine law is equal to

q^2=c^2+d^2-2cd cos⁡(∡BCD)

And angle ∡BCD is:
∡BCD=cos^(-1)⁡((c^2+d^2-q^2)/2cd)=103.7°
Angle γ is equal to:
γ = 2π − ∡BCD = 360 − 103.7° = 256.3
Angle ∡ CBD is equal to:
∡CBD=sin^(-1)⁡((d sin⁡〖∡BCD〗)/q)=34.7°
And angle β is equal to:
β = ∡ABD − ∡CBD = 62.3 − 34.7 = 27.6°
The diagonal p is:
p^2=b^2+c^2-2bc cos⁡β
p = 4.3
δ angle, from cosine law is:
p^2=a^2+d^2-2ad cos⁡δ
⁡δ = 11.18°
The aria of the quadrilateral is:
area=∆ABC+∆ACD=1/2 bc sin⁡β+1/2 ad sin⁡δ
area=1/2 9∙7 sin⁡27.6+1/2 10∙6 sin⁡11.18=20.4

Example 5 - Area of vertices coordinates.

Print example 5
Find the area of a quadrilateral given by the points of its vertices, as (0 , 2), (-2 , 3), (-1 , 5) and (3 , 4).
Example 5
To find the area of the quadrilateral, we divide it into two triangles, △𝐴𝐵𝐶 and △𝐶𝐷𝐴. The solution relies on the fact that the cross product of two vectors gives the area of the parallelogram spanned by those vectors, which is equal to twice the area of the corresponding triangle.

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

A_area=1/2 |(AB) ̅×p ̅ |+1/2 |p ̅×(AD) ̅ |
A_area=A_1+A_2=1/2 |(|■(-2&1@-1&3)|+|■(-1&3@3&2)|)|=|1/2 (-5)+1/2 (-11)|=8
The area by cross product of the diagonal is:
A_area=1/2 |p ̅×q ̅ |

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

And the area is:
A_area=1/2 |■(-1&3@-5&-1)|=1/2 (1+15)=8