Triangles and area coordinates
December 15, 2022 at 2:31 PM by Dr. Drang
Earlier this month, John D. Cook posted a nice little article about using a determinant to get the area of a triangle. The method was both familiar and unfamiliar. I knew I’d once learned about getting a triangle’s area from a determinant, but I was sure it wasn’t the same way Cook did it. So I pulled my favorite finite element textbook^{1} off the shelf to refresh my memory. Now I’m going to inflict that memory on you.
In Cook’s post, he starts with a triangle whose vertices are defined by the three complex variables ${z}_{1}$, ${z}_{2}$, and ${z}_{3}$, where the real part of each variable is the xcoordinate and the imaginary part is the ycoordinate. The area of the triangle can be computed through this nonobvious formula:
$$A=\frac{i}{4}\phantom{\rule{0.167em}{0ex}}\left\begin{array}{ccccccccccc}{z}_{1}& {\stackrel{\u2015}{z}}_{1}& 1& \#92;& \#92;{z}_{2}& {\stackrel{\u2015}{z}}_{2}& 1& \#92;& \#92;{z}_{3}& {\stackrel{\u2015}{z}}_{3}& 1\end{array}\right$$where the straight lines on either side of the matrix represent the determinant, and a bar over a variable represents the complex conjugate.
Although this is a compact and easytoremember formula, I knew it wasn’t the one I learned back in my finite element analysis class, primarily because we didn’t use complex variables in that class. But we did use area coordinates, and that’s where I learned how to get the area of a triangle from a (different) determinant.
Area coordinates—also called natural coordinates—for triangles are a set of three variables, ${\xi}_{1}$, ${\xi}_{2}$, and ${\xi}_{3}$, that conveniently define a point within a triangle. Given the point P shown below, its coordinates are
$${\xi}_{1}=\frac{{A}_{1}}{A},\phantom{\rule{1em}{0ex}}{\xi}_{2}=\frac{{A}_{2}}{A},\phantom{\rule{1em}{0ex}}{\xi}_{3}=\frac{{A}_{3}}{A}$$where $A$ is the area of the entire triangle, and
$${A}_{1}+{A}_{2}+{A}_{3}=A$$The advantage of using area coordinates is shown in the drawing on the right.^{2} For each vertex, one of the coordinates is one and the other two are zero. Along each side, one of the coordinates is zero and the other two add to one. Another nicety of area coordinates is that the centroid of the triangle is at $(\frac{1}{3},\frac{1}{3},\frac{1}{3})$.
Of course, using three coordinates to define a point in a plane involves one degree of redundancy. If you know two of the coordinates, the third can always be calculated through
$${\xi}_{1}+{\xi}_{2}+{\xi}_{3}=1$$which is a direct consequence of the area summation formula above.
If you’re dealing with just one triangle, there’s not much value in using area coordinates. But if you’re doing a finite element analysis with triangular elements, you can easily have thousands of elements, so the consistency of area coordinates can be a big help—if you can easily transform between the $xy$ and area coordinate systems. And you can. Here’s the relationship:
$$\left\{\begin{array}{ccccc}1& \#92;& \#92;x& \#92;& \#92;y\end{array}\right\}=\left[\begin{array}{ccccccccccc}1& 1& 1& \#92;& \#92;{x}_{1}& {x}_{2}& {x}_{3}& \#92;& \#92;{y}_{1}& {y}_{2}& {y}_{3}\end{array}\right]\left\{\begin{array}{ccccc}{\xi}_{1}& \#92;& \#92;{\xi}_{2}& \#92;& \#92;{\xi}_{3}\end{array}\right\}$$Note that the top row of the transformation matrix represents the constraint equation among the area coordinates.
The inverse transformation isn’t as nice, but it’s not too bad:
$$\left\{\begin{array}{ccccc}{\xi}_{1}& \#92;& \#92;{\xi}_{2}& \#92;& \#92;{\xi}_{3}\end{array}\right\}=\frac{1}{2A}\left[\begin{array}{ccccccccccc}{x}_{2}{y}_{3}{x}_{3}{y}_{2}& {y}_{2}{y}_{3}& {x}_{3}{x}_{2}& \#92;& \#92;{x}_{3}{y}_{1}{x}_{1}{y}_{3}& {y}_{3}{y}_{1}& {x}_{1}{x}_{3}& \#92;& \#92;{x}_{1}{y}_{2}{x}_{2}{y}_{1}& {y}_{1}{y}_{2}& {x}_{2}{x}_{1}\end{array}\right]\left\{\begin{array}{ccccc}1& \#92;& \#92;x& \#92;& \#92;y\end{array}\right\}$$If you remember how matrix inversion works, you may suspect that $2A$ is the determinant of the original transformation matrix. And you’d be right. Therefore, the area can be calculated through this simple determinant:
$$A=\frac{1}{2}\left\begin{array}{ccccccccccc}1& 1& 1& \#92;& \#92;{x}_{1}& {x}_{2}& {x}_{3}& \#92;& \#92;{y}_{1}& {y}_{2}& {y}_{3}\end{array}\right$$It’s as easy to remember as the formula Cook wrote about and easier to compute—no need to carry around two terms for each variable.
It’s not too hard to show that this determinant and Cook’s are equivalent, especially if you have a computer algebra system. Both areas can be reduced to
$$A=\frac{1}{2}[\phantom{{y}^{2}}{x}_{1}\phantom{\rule{0.222em}{0ex}}({y}_{2}{y}_{3})+{x}_{2}\phantom{\rule{0.222em}{0ex}}({y}_{3}{y}_{1})+{x}_{3}\phantom{\rule{0.222em}{0ex}}({y}_{1}{y}_{2})]$$which takes up less space vertically but isn’t really any simpler than the area coordinatesbased determinant form.

Amazon has the fourth and current edition (2001) of the Concepts and Applications of Finite Element Analysis, written by Robert Cook (no relation to John, as far as I know) and various coauthors. It’s still in print after 20 years without a revision, a testament to its value. I have the third edition (1989) and learned from the second edition (1981). ↩

I wish the triangle in the figure, which I scanned from Chapter 5 of Robert Cook’s book, didn’t look so much like an equilateral triangle. Area coordinates can be used on any triangle. ↩