Barycentric coordinates (t1, t2, t3) 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 non-zero, of the three vertices such that P is their centroid, or weighted average. If A, B, and C are given by vectors, and (t1, t2, t3) are the barycentric coordinates of P, then
P = (t1A + t2B + t3C) / (t1+t2+t3)
The requirement that the sum of the barycentric coordinates be non-zero 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 "non-homogeneous", which means they are not "normalized" in any way. They are simply three real numbers whose sum is non-zero. 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 t1+t2+t3=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 non-collinear points A, B, and C satisfying
P = t1A + t2B + t3C
Since all the coordinates are non-negative, 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].
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 x-y 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:
t1a + t2c + t3e = x
t1b + t2d + t3f = y
t1 + t2 + t3 = 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 t1, t2, t3. 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+eb-bc-de-fa). The numerator is this expression with (a,b) replaced by (x,y) for t1, and with (c,d) replaced with (x,y) for t2, and with (e,f) replaced by (x,y) for t3. Putting it all together,
t1 = (xd+cf+ey-yc-de-fx)/(ad+cf+eb-bc-de-fa)
t2 = (ay+xf+eb-bx-ye-fa)/(ad+cf+eb-bc-de-fa)
t3 = (ad+cy+xb-bc-dx-ya)/(ad+cf+eb-bc-de-fa)
Applying this to our specific example, we have the equations
4t1 + 2t2 + 6t3 = x
6t1 + 1t2 + 3t3 = y
t1 + t2 + t3 = 1
So we have the denominator of the expression for each coordinate being (4*1+2*3+6*6-6*2-1*6-3*4)=16, which happens by no coincidence to be twice the area of triangle ABC. Then the numerators are
t1 = (1x+2*3+6y-2y-1*6-3x)/16 = (-2x+4y)/16
t2 = (4y+3x+6*6-6x-6y-3*4)/16 = (-3x-2y+24)/16
t3 = (4*1+2y+6x-6*2-1x-4y)/16 = (5x-2y-8)/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
which is (ad+cf+eb-bc-de-fa), 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
which, in our case is -2x+4y. Similarly, twice the area of PCA is -3x-2y+24, and twice the area of PAB is 5x-2y-8.
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 -3x-2y+24=0, and the area of triangle PCA is -3x-2y+24;
The equation for line AB is 5x-2y-8=0, and the area of triangle PAB is 5x-2y-8;
Note that in each case, the coefficients for the equation of the lines could be multiplied by any non-zero 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.