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.
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.
There are several equivalent formulas. One common approach uses determinants (or signed areas). Define the denominator Δ as
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.
The calculator takes as input the coordinates of the triangle vertices A, B, C and a point P. It then:
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.
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.
Consider a triangle with vertices
and let us compute the barycentric coordinates of point
P = (1, 1).
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.
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.
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.
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.
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).
Barycentric coordinates appear in many areas of mathematics and applied science:
| 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) |
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.