Barycentric Coordinate Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What Are Barycentric Coordinates?

Barycentric coordinates provide a way to describe the position of a point relative to the vertices of a triangle instead of using the usual Cartesian coordinates. For a triangle with vertices A, B, and C, any point P in the plane can be written as a weighted combination of these three vertices. The weights are the barycentric coordinates.

Suppose the triangle has vertices

and P = (x, y) is any point in the 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) is called the barycentric coordinates of P with respect to triangle ABC.

Key Properties and Interpretation

Geometrically, you can think of barycentric coordinates as expressing P as a “center of mass” of three point masses placed at A, B, and C, with masses proportional to λ1, λ2, and λ3.

Formulas for Barycentric Coordinates

There are several equivalent formulas. One common approach uses determinants (or signed areas). Define the denominator Δ as

Δ = x1 y1 1

In expanded 2D form, this is usually written as

Δ = (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 will treat this as an error condition).

Given P = (x, y), one convenient formula for the barycentric coordinates is

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

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

λ3 = 1 - λ1 - λ2.

Algebraically equivalent variants using 3×3 determinants or raw coordinate products are also common, and the calculator uses one of these determinant-based formulations internally.

How the Calculator Works

The calculator takes as input the coordinates of the triangle vertices A, B, C and a point P. It then:

  1. Computes the denominator Δ from A, B, and C to ensure the triangle is not degenerate (collinear vertices).
  2. Computes three sub-determinants or area-like expressions that correspond to areas of sub-triangles PBC, APC, and ABP.
  3. Divides each sub-determinant by Δ to obtain λ1, λ2, and λ3.
  4. Checks for numerical rounding and presents the coordinates, usually to a fixed number of decimal places.

Because these formulas use standard floating-point arithmetic, extremely large or small coordinate values may introduce small rounding errors. However, the sum of the three barycentric coordinates should still be very close to 1.

Interpreting the Calculator Output

After you click the compute button, you will see three numbers corresponding to (λ1, λ2, λ3). To read these values:

This makes barycentric coordinates a natural tool for point-in-triangle tests, interpolation, and geometric reasoning on triangles.

Worked Example

Consider a triangle with vertices

and let us compute the barycentric coordinates of point

P = (1, 1).

Step 1: Compute Δ

Using the denominator formula

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

we substitute

Then

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

Step 2: Compute λ1

Using the area/determinant-based formula (one common variant) for λ1:

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

Here x = 1, 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 λ2

A symmetric formula for λ2 is

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

Compute the 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 λ3

Finally, use the fact that the three coordinates sum to 1:

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

Note that 1/4 = 3/12, so

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

Step 5: Interpret the Result

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

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

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

You can enter these same coordinates into the calculator to verify that you obtain essentially the same barycentric values (small differences may occur due to rounding of intermediate steps).

Applications and Use Cases

Barycentric coordinates appear in many areas of mathematics and applied science:

Comparison 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

As long as you supply three non-collinear vertices in 2D and reasonable coordinate magnitudes, the barycentric coordinates produced by this tool will give a clear and reliable description of where your point lies relative to the triangle.

Fill in triangle vertices and a point.

Embed this calculator

Copy and paste the HTML below to add the Barycentric Coordinate Calculator - Explore Triangle Geometry to your website.