Barycentric Coordinate Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Barycentric Coordinates Relative to a Triangle

Barycentric coordinates describe where a point sits relative to the vertices of one specific triangle rather than relative to fixed Cartesian axes. For a triangle with vertices A, B, and C, any point P in the plane can be written as a weighted combination of those three vertices. The weights are the barycentric coordinates.

For this barycentric-coordinate calculation, let the triangle vertices be

and P = (x, y) is a point in the same plane. Then there exist numbers λ1, λ2, λ3 such that

P = λ1A + λ2B + λ3C,

with the constraint

λ1 + λ2 + λ3 = 1.

The triple (λ1, λ2, λ3) gives the barycentric coordinates of P with respect to triangle ABC. Each coordinate is paired with its corresponding vertex: λ1 with A, λ2 with B, and λ3 with C.

Barycentric Coordinate Properties and Triangle Position

Geometrically, barycentric coordinates express P as a “center of mass” of point masses placed at A, B, and C, with masses proportional to λ1, λ2, and λ3. This interpretation is useful because it ties the numerical weights directly to the triangle’s vertices.

Determinant Formulas for Barycentric Coordinates

This barycentric coordinate calculator uses a signed determinant to measure the triangle’s orientation and area-like denominator. Define the denominator Δ as

Δ = x1y11 x2y21 x3y31

In expanded 2D form, this denominator is

Δ = (x2 - x1)(y3 - y1) - (x3 - x1)(y2 - y1).

If Δ = 0, the three vertices are collinear and do not form a valid triangle, so barycentric coordinates are not defined. The calculator reports this as a triangle-area error condition.

Given P = (x, y), the calculator’s determinant ratios give the barycentric coordinates as

λ1 = ((x2 - x)(y3 - y) - (x3 - x)(y2 - y)) / Δ,

λ2 = ((x3 - x)(y1 - y) - (x1 - x)(y3 - y)) / Δ,

λ3 = 1 - λ1 - λ2.

Equivalent 3×3 determinant and signed-area forms produce the same barycentric weights when the vertex order is kept consistent. The calculator evaluates this determinant-based relationship directly from the eight entered coordinates.

Introduction: Barycentric Coordinate Calculation Steps

The barycentric coordinate calculator accepts the Cartesian coordinates of triangle vertices A, B, and C together with the Cartesian coordinates of point P. It then:

  1. Computes the denominator Δ from A, B, and C to ensure the triangle is not degenerate (collinear vertices).
  2. Computes the determinant expressions associated with the sub-triangles PBC and APC.
  3. Divides those expressions by Δ to obtain λ1 and λ2, then obtains λ3 from the requirement that the three weights sum to 1.
  4. Formats the three resulting weights and their displayed sum to four decimal places.

Because this barycentric computation uses standard floating-point arithmetic, extremely large or very small coordinate values may introduce small rounding errors. Even so, the unrounded weights are constructed so their sum is 1.

Interpreting Barycentric Coordinate Calculator Output

After you compute a triangle point’s barycentric coordinates, the result lists (λ1, λ2, λ3) and their sum. Read the output as follows:

These triangle-relative weights make barycentric coordinates useful for point-in-triangle tests, interpolation, and geometric reasoning. The calculator’s inside/outside message follows the signs of the three calculated weights.

Worked Example: Barycentric Weights in a Right Triangle

This barycentric coordinate example uses a triangle with vertices

and calculates the weights of point

P = (1, 1).

Step 1: Compute the Triangle Determinant Δ

Using the barycentric denominator formula

Δ = (x2 - x1)(y3 - y1) - (x3 - x1)(y2 - y1),

substitute the triangle’s vertex coordinates:

Then

Δ = (4 - 0)(3 - 0) - (0 - 0)(0 - 0) = 4 × 3 - 0 = 12.

Step 2: Compute the Weight at Vertex A, λ1

For this triangle, the determinant formula for the weight associated with A is

λ1 = ((x2 - x)(y3 - y) - (x3 - x)(y2 - y)) / Δ.

Here x = 1 and y = 1, so

Thus

(x2 - x)(y3 - y) = 3 × 2 = 6,

(x3 - x)(y2 - y) = (-1) × (-1) = 1,

so

λ1 = (6 - 1) / 12 = 5 / 12 ≈ 0.4167.

Step 3: Compute the Weight at Vertex B, λ2

The corresponding barycentric formula for the weight at B is

λ2 = ((x3 - x)(y1 - y) - (x1 - x)(y3 - y)) / Δ.

Compute the coordinate differences:

Then

(x3 - x)(y1 - y) = (-1) × (-1) = 1,

(x1 - x)(y3 - y) = (-1) × 2 = -2,

so

λ2 = (1 - (-2)) / 12 = 3 / 12 = 0.25.

Step 4: Compute the Weight at Vertex C, λ3

The final barycentric weight follows from the requirement that all three weights sum to 1:

λ3 = 1 - λ1 - λ2 = 1 - 5/12 - 1/4.

Since 1/4 = 3/12,

λ3 = 1 - 5/12 - 3/12 = 1 - 8/12 = 4/12 = 1/3 ≈ 0.3333.

Step 5: Interpret the Triangle Position

The barycentric coordinates of P with respect to triangle ABC are approximately

1, λ2, λ3) ≈ (0.4167, 0.25, 0.3333).

All three weights are positive and less than 1, and together they sum to 1, so P lies inside the triangle. In vertex terms, P is the weighted average of A, B, and C using those three values.

Entering these coordinates in the calculator produces the same barycentric weights, with the displayed values rounded to four decimal places.

How to Use Barycentric Coordinates: Applications and Use Cases

Barycentric coordinates are especially valuable whenever a calculation must relate a point to the vertices of a triangle:

Barycentric Coordinates Compared with Other Coordinate Systems

Coordinate System Definition Domain Main Use in Triangle Geometry Key Advantages
Barycentric Relative to triangle vertices A, B, C Point-in-triangle tests, interpolation, FEM Coordinates sum to 1, easy to detect inside/outside, natural for interpolation on triangles
Cartesian (x, y) Entire 2D plane with fixed axes General geometry and algebraic calculations Simple arithmetic, standard in most applications, independent of any particular triangle
Polar (r, θ) Plane with respect to a chosen origin Radially symmetric problems, rotations Convenient for circular or rotational symmetry, but less direct for triangles
Affine (u, v) on a triangle Parameters along two edges of a triangle Texture mapping, simple parameterizations Closely related to barycentric coordinates (often two of the three barycentric coordinates)

Limitations and Assumptions for 2D Barycentric Coordinates

With three non-collinear 2D vertices and reasonably scaled coordinate values, this barycentric coordinate tool provides a direct description of P’s location relative to triangle ABC.

Fill in triangle vertices and a point.

Arcade Mini-Game: Barycentric Coordinate Calculator Calibration Run

Use this short arcade exercise to identify the vertex-coordinate inputs needed for a barycentric triangle calculation and avoid unrelated choices.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch triangle-coordinate inputs and avoid unrelated assumptions.