What is the simplest way to find out the area of a triangle if the coordinates of the three vertices are given in x–y plane?
One approach is to find the length of each side from the coordinates given and then apply Heron’s formula. Is this the best way possible?
Is it possible to compare the area of triangles with their coordinates provided without actually calculating side lengths?
Answer
What you are looking for is called the shoelace formula:
Area=12|(xA−xC)(yB−yA)−(xA−xB)(yC−yA)|=12|xAyB+xByC+xCyA−xAyC−xCyB−xByA|=12|det
The last version tells you how to generalize the formula to higher dimensions.
PS. Another generalization of the formula is obtained by noting that it follows from a discrete version of the Green’s theorem:
\text{Area} = \iint_{\text{domain}}dx\,dy = \frac12\oint_{\text{boundary}}x\,dy – y\,dx
Thus the signed (oriented) area of a polygon with n vertexes (x_i,y_i) is
\frac12\sum_{i=0}^{n-1} x_i y_{i+1} – x_{i+1} y_i
where indexes are added modulo n.
Attribution
Source : Link , Question Author : TSP1993 , Answer Author : sds