
Barycentric coordinates (t_{1}, t_{2}, t_{3}) are a system of locating points with respect to an arbitrary triangle. If the vertices of a triangle are labeled A, B, C in counterclockwise order, and the sides opposite each vertex are called a, b, c, then the barycentric coordinates of point P are the weights, whose sum is nonzero, of the three vertices such that P is their centroid, or weighted average. If A, B, and C are given by vectors, and (t_{1}, t_{2}, t_{3}) are the barycentric coordinates of P, then
P = (t_{1}A + t_{2}B + t_{3}C) / (t_{1}+t_{2}+t_{3})
The requirement that the sum of the barycentric coordinates be nonzero comes about so that their weighted average is meaningful. They need not be positive, however. If at least one weight is positive, and at least one weight is negative, then the point specified by these coordinates is outside the triangle.
So far, the barycentric coordinates that have been discussed on this page are "nonhomogeneous", which means they are not "normalized" in any way. They are simply three real numbers whose sum is nonzero. Barycentric coordinates are commonly normalized in two ways:
1. Areal coordinates of point P are normalized barycentric coordinates. They are normalized so that they become the areas (hence the name, areal) of the subtriangles formed by connecting P with each of the triangle's vertices, and where the area is measured in terms of the area of triangle ABC. This way of normalizing the coordinates is equivalent to specifying t_{1}+t_{2}+t_{3}=1.
2. Homogeneous barycentric coordinates of point P are normalized so that they represent the actual areas of the subtriangles formed by connecting P with each of the triangle's vertices.
Question: Suppose you are given the barycentric coordinates of point P as (.5, .25, .25), and you are asked to illustrate where point P is with respect to the vertices of the reference triangle.
Answer: Note that the sum of the three coordinates given is 1. Thus the coordinates are normalized, or areal, coordinates. The point P is a barycentric combination of three points if it is a linear combination of three noncollinear points A, B, and C satisfying
P = t_{1}A + t_{2}B + t_{3}C
Since all the coordinates are nonnegative, point P (the barycentric combination) is either on or inside the triangle formed by A, B, and C.
Since you didn't specify the locations of A, B, and C but only asked for an illustration, I will make up some arbitrary locations of these points.
Let A = [4,6],
B = [2,1], and
C = [6,3].
Then,
P = .5 [4,6] + .25 [2,1] + .25 [6,3]
P = [2,3] + [.5,.25] + [1.5,.75]
P = [4,4]
Notice that triangle PBC encompasses half the total area. That's because the first barycentric coordinate is .5. The subtriangles' areas are in proportion to the corresponding barycentric coordinates.
Question: Suppose you are given the xy coordinates of point P as [4,4] and the coordinates of the vertices of triangle ABC as [4,6], [2,1], and [6,3]. How would you reconstruct the barycentric coordinates of P?
Answer: Let's just answer the general case using a blunt instrument: we'll find the barycentric coordinates of P(x,y) given A(a,b) B(c,d) C(e,f) by solving the barycentric equations:
t_{1}a + t_{2}c + t_{3}e = x
t_{1}b + t_{2}d + t_{3}f = y
t_{1} + t_{2} + t_{3} = 1
Now, since we're given x, y, a, b, c, d, e, and f, we can treat these as constants and solve for the unknowns t_{1}, t_{2}, t_{3}. Viewed this way, it's just a matter of solving the linear equations. Cramer's method gives the easiest solution, because the determinants are easy to calculate. The denominator of the expression for each coordinate is the determinant of the coefficient matrix, which is (ad+cf+ebbcdefa). The numerator is this expression with (a,b) replaced by (x,y) for t_{1}, and with (c,d) replaced with (x,y) for t_{2}, and with (e,f) replaced by (x,y) for t_{3}. Putting it all together,
t_{1} = (xd+cf+eyycdefx)/(ad+cf+ebbcdefa)
t_{2} = (ay+xf+ebbxyefa)/(ad+cf+ebbcdefa)
t_{3} = (ad+cy+xbbcdxya)/(ad+cf+ebbcdefa)
Applying this to our specific example, we have the equations
4t_{1} + 2t_{2} + 6t_{3} = x
6t_{1} + 1t_{2} + 3t_{3} = y
t_{1} + t_{2} + t_{3} = 1
So we have the denominator of the expression for each coordinate being (4*1+2*3+6*66*21*63*4)=16, which happens by no coincidence to be twice the area of triangle ABC. Then the numerators are
t_{1} = (1x+2*3+6y2y1*63x)/16 = (2x+4y)/16
t_{2} = (4y+3x+6*66x6y3*4)/16 = (3x2y+24)/16
t_{3} = (4*1+2y+6x6*21x4y)/16 = (5x2y8)/16
Ratio of Areas interpretation: The normalized barycentric coordinates, also called "areal" coordinates, are the ratios of the areas of the subtriangles to the area of the reference triangle, ABC. Given the coordinates A(a,b) B(c,d) C(e,f), we find twice the area of the reference triangle by simply finding the determinant of the matrix
a,c,e;
b,d,f;
1,1,1;
which is (ad+cf+ebbcdefa), or 16 for our triangle, as we determined in our answer, above, to this question. Now twice the area of triangle PBC is determined the same way as the determinant of
x,c,e;
y,d,f;
1,1,1;
which, in our case is 2x+4y. Similarly, twice the area of PCA is 3x2y+24, and twice the area of PAB is 5x2y8.
There is an interesting relation between the equation for the side of a triangle and the area of the subtriangle formed by that side.
The equation for line BC is 2x+4y+0=0, and the area of triangle PAB is 2x+4y+0;
The equation for line CA is 3x2y+24=0, and the area of triangle PCA is 3x2y+24;
The equation for line AB is 5x2y8=0, and the area of triangle PAB is 5x2y8;
Note that in each case, the coefficients for the equation of the lines could be multiplied by any nonzero constant, and the equation would represent the same line. In this case, the coefficients were carefully chosen so that the x coefficient was the negative of the "difference of the y's" and the y coefficient was the positive "difference of the x's" between the two endpoints of each side of the triangle.
Mathworld: Barycentric Coordinates
Triangle Centers  each triangle center is given in a number of ways, including its barycentric coordinates.
Point and Triangle 3  a program to determine whether a point is inside a triangle; a formula for calculating the barycentric coordinates of a point with respect to a given triangle.
Buckets and Springs puzzle  a puzzle whose solution involves barycentric coordinates.
The webmaster and author of this Math Help site is Graeme McRae.