Mathwords logoMathwords

Barycentric Coordinates — Definition, Formula & Examples

Barycentric coordinates describe the location of a point relative to a triangle by assigning a weight to each vertex. A point's position is the weighted average of the three vertices, where the weights sum to 1.

Given a triangle with vertices AA, BB, CC, the barycentric coordinates of a point PP are scalars (λ1,λ2,λ3)(\lambda_1, \lambda_2, \lambda_3) such that P=λ1A+λ2B+λ3CP = \lambda_1 A + \lambda_2 B + \lambda_3 C and λ1+λ2+λ3=1\lambda_1 + \lambda_2 + \lambda_3 = 1. When all three coordinates are non-negative, PP lies inside or on the boundary of the triangle.

Key Formula

P=λ1A+λ2B+λ3C,λ1+λ2+λ3=1P = \lambda_1 A + \lambda_2 B + \lambda_3 C, \quad \lambda_1 + \lambda_2 + \lambda_3 = 1
Where:
  • PP = The point being described
  • A,B,CA, B, C = The three vertices of the reference triangle
  • λ1,λ2,λ3\lambda_1, \lambda_2, \lambda_3 = Weights (barycentric coordinates) assigned to each vertex

How It Works

Each barycentric coordinate represents the ratio of the sub-triangle area opposite that vertex to the total triangle area. For instance, λ1\lambda_1 equals the area of triangle PBCPBC divided by the area of triangle ABCABC. If PP sits exactly at vertex AA, its coordinates are (1,0,0)(1, 0, 0). The centroid of the triangle always has coordinates (13,13,13)(\tfrac{1}{3}, \tfrac{1}{3}, \tfrac{1}{3}). A negative coordinate means the point lies outside the triangle, on the far side of the opposite edge.

Worked Example

Problem: A triangle has vertices A=(0,0)A = (0, 0), B=(6,0)B = (6, 0), C=(0,4)C = (0, 4). Find the Cartesian position of the point with barycentric coordinates (0.5,0.25,0.25)(0.5,\, 0.25,\, 0.25).
Step 1: Apply the formula P=λ1A+λ2B+λ3CP = \lambda_1 A + \lambda_2 B + \lambda_3 C using the given weights.
P=0.5(0,0)+0.25(6,0)+0.25(0,4)P = 0.5(0,0) + 0.25(6,0) + 0.25(0,4)
Step 2: Compute each weighted term and add.
P=(0,0)+(1.5,0)+(0,1)=(1.5,1)P = (0,0) + (1.5, 0) + (0, 1) = (1.5,\, 1)
Step 3: Verify the weights sum to 1: 0.5+0.25+0.25=10.5 + 0.25 + 0.25 = 1. The point lies inside the triangle since all coordinates are positive.
Answer: The point is at Cartesian coordinates (1.5,1)(1.5,\, 1).

Why It Matters

Barycentric coordinates are essential in computer graphics for texture mapping, ray-triangle intersection tests, and interpolating color or depth across a triangle. In physics, they locate a system's center of mass. They also simplify many classic triangle geometry proofs by replacing distance-based reasoning with algebraic ratios.

Common Mistakes

Mistake: Forgetting that the three coordinates must sum to 1 for normalized barycentric coordinates.
Correction: Always check λ1+λ2+λ3=1\lambda_1 + \lambda_2 + \lambda_3 = 1. If you compute unnormalized weights (e.g., sub-triangle areas), divide each by the total triangle area to normalize.