Barycentric coordinates
Interpolation values
Drag A, B, C, or P in the diagram, or edit the numeric fields directly.
Use this Barycentric Coordinates Calculator to enter values, adjust options, and review results in a compact responsive workspace.
Results are calculated automatically as you enter data.
Drag A, B, C, or P in the diagram, or edit the numeric fields directly.
▼ See explanations and tips below ▼
Barycentric coordinates describe the position of a point by using a triangle’s vertices as reference points. Instead of saying a point has only an \(x\) coordinate and a \(y\) coordinate, barycentric coordinates say how much of vertex \(A\), vertex \(B\), and vertex \(C\) is needed to make the point.
For a triangle with vertices \(A\), \(B\), and \(C\), a point \(P\) has barycentric coordinates \(\lambda_A\), \(\lambda_B\), and \(\lambda_C\) when
and
The three values are often called weights. If all three weights are between \(0\) and \(1\), the point is inside the triangle or on its boundary. If one weight is negative or greater than \(1\), the point is outside the triangle. This makes barycentric coordinates useful both as a coordinate system and as a point-in-triangle test.
Barycentric coordinates are especially helpful because the same weights can locate the point, classify the point, and interpolate values across the triangle. For example, if each vertex has a temperature, height, color intensity, or other scalar value, the barycentric weights give a linear estimate of the value at \(P\).
Barycentric coordinates turn many triangle problems into weight problems. Once the three weights are known, you can answer questions such as:
This is why barycentric coordinates appear in coordinate geometry, computer graphics, collision detection, finite element methods, mesh processing, and interpolation. In graphics, the same idea can be used to interpolate color, depth, texture coordinates, or normals over a triangle. In numerical methods, barycentric coordinates are related to linear shape functions on triangular elements.
For 2D coordinates, the signed double area of a triangle with points \(X=(x_X,y_X)\), \(Y=(x_Y,y_Y)\), and \(Z=(x_Z,y_Z)\) can be written as
The ordinary unsigned area of triangle \(XYZ\) is
Barycentric coordinates can be computed as signed area ratios. For triangle \(ABC\) and point \(P\), the denominator is the signed double area of the full triangle:
The three weights are then
Each numerator is the signed double area of the subtriangle opposite that vertex. For example, \(\lambda_A\) uses triangle \(PBC\), which is opposite vertex \(A\).
These ratios work because connecting \(P\) to the three vertices splits the reference triangle into three opposite subtriangles. When \(P\) is inside the triangle, those subareas are all positive after orientation is handled consistently, and the three area ratios add to \(1\). When \(P\) moves outside the triangle, one or more signed subareas become negative, but the same formulas still produce meaningful barycentric coordinates.
The weights classify the point:
| Weight pattern | Meaning |
|---|---|
| \(0 < \lambda_A, \lambda_B, \lambda_C < 1\) | \(P\) is strictly inside the triangle. |
| One weight is \(0\), and the others are between \(0\) and \(1\) | \(P\) is on the edge opposite the zero-weight vertex. |
| One weight is \(1\), and the other two are \(0\) | \(P\) is at a vertex. |
| Any weight is negative or greater than \(1\) | \(P\) is outside the triangle. |
Once the weights are known, scalar interpolation is straightforward. If the values at the vertices are \(V_A\), \(V_B\), and \(V_C\), then the interpolated value at \(P\) is
Inside the triangle, this is a weighted average of the vertex values. Outside the triangle, the same formula becomes extrapolation.
Suppose the triangle vertices are
and the point is
The signed double area of the full triangle is
So the triangle area is
Now compute the opposite signed double areas:
The barycentric weights are therefore
They sum to \(1\):
All three weights are between \(0\) and \(1\), so \(P\) is inside the triangle.
You can also check that the weights reconstruct the point:
If the vertex values are \(V_A=10\), \(V_B=20\), and \(V_C=35\), the interpolated value is
Use the same triangle, but let
This point lies on edge \(AB\). The weights are
The zero value of \(\lambda_C\) means the point is on the edge opposite vertex \(C\), which is edge \(AB\). The other two weights show that the point is \(60\%\) influenced by \(A\) and \(40\%\) influenced by \(B\) along that edge.
With vertex values \(10\), \(20\), and \(35\), the interpolated value is
Again use the same triangle, but let
The weights are
The weights still sum to \(1\):
However, \(\lambda_A\) is negative and \(\lambda_B\) is greater than \(1\), so the point is outside the triangle. If the same vertex values are used, the formula gives
Because \(P\) is outside the triangle, this value is an extrapolated result rather than an inside-triangle weighted average.
The three lambda values are the barycentric coordinates of \(P\) with respect to triangle \(ABC\). They are dimensionless weights, so they do not use coordinate units. Apart from small numerical rounding error, they should add to \(1\).
A weight near \(0\) means \(P\) is near the edge opposite that vertex. For example, if \(\lambda_A\) is near \(0\), then \(P\) is near edge \(BC\). If \(\lambda_A=1\) and the other two weights are \(0\), the point is at vertex \(A\).
The classification result summarizes the weight pattern. Inside means all weights are within the accepted range from \(0\) to \(1\). Boundary or edge means at least one weight is effectively \(0\). Vertex means one weight is effectively \(1\) and the others are effectively \(0\). Outside means at least one weight falls outside the accepted range.
The triangle area is the absolute area of triangle \(ABC\), reported in squared coordinate units. If your coordinates are in meters, the area is in square meters. If your coordinates are in arbitrary drawing units, the area is in squared drawing units.
The oriented opposite subareas show the signed area contributions associated with each vertex. These are useful for understanding why a weight is positive, zero, or negative. Negative oriented subareas usually appear when \(P\) is outside the triangle.
When all three scalar values are supplied, the interpolated value is in the same scalar unit as the values entered at \(A\), \(B\), and \(C\). If the vertex values represent temperature, the result is a temperature. If they represent height, the result is a height. If \(P\) is outside the triangle, treat the value as extrapolated. Without all three scalar values, the coordinate, table, and graph results remain available.
Approximate fractions are readability aids. They are useful when a weight is close to a simple fraction such as \(\frac{1}{2}\) or \(\frac{1}{3}\), but they should not be treated as exact symbolic results unless the underlying values are known to be exact.
One common mistake is using three collinear vertices. A triangle needs non-collinear vertices. If \(A\), \(B\), and \(C\) lie on one straight line, the area is \(0\), and the barycentric area ratios cannot be computed.
Another mistake is mixing coordinate systems or units. The \(x\) and \(y\) coordinates for \(A\), \(B\), \(C\), and \(P\) must all belong to the same 2D Cartesian coordinate system. Do not mix pixels with meters, map coordinates with screen coordinates, or differently scaled axes unless that is truly the coordinate system you intend to use.
Users sometimes confuse point coordinates with vertex scalar values. The coordinates of \(P\) locate the point in the plane. The values \(V_A\), \(V_B\), and \(V_C\) are separate scalar quantities used only for interpolation.
Negative weights are not invalid by themselves. They usually mean the point is outside the triangle. The calculator can still report the barycentric coordinates, and any interpolated scalar value with all three supplied vertex values should be understood as extrapolation.
Rounding too early can also cause confusion. A point very close to an edge may have a tiny positive or negative weight because of floating-point precision. For near-boundary points, use the classification and warning messages together with the displayed weights.
Finally, approximate fractions should not be mistaken for exact rational arithmetic. A displayed fraction is only a convenient approximation of the decimal weight.
Use barycentric coordinates when you need to:
Barycentric coordinates are most useful when the region is triangular and the value you want to estimate varies linearly across that triangle.
This calculator is for 2D triangle barycentric coordinates. It does not directly handle tetrahedral 3D barycentric coordinates, polygonal generalized barycentric coordinates, or multiple interpolated value channels.
The triangle must be non-degenerate. If the vertices are collinear or nearly collinear at the entered coordinate scale, the signed area denominator becomes zero or too small for a stable result.
Very large coordinates, very skinny triangles, or points extremely close to an edge can make classification sensitive to numerical precision. In those cases, a tiny change in coordinates may change whether a point is shown as on the boundary, just inside, or just outside.
The calculator uses JavaScript Number arithmetic (IEEE 754 binary64 floating-point), so displayed values are rounded. Weights, areas, subareas, fractions, and interpolated values may be formatted to different decimal places. The three weights should sum to \(1\), but the displayed rounded values may not add perfectly.
The scalar interpolation formula is linear. It is appropriate when a value is assumed to change linearly across the triangle. It is not a model for curved surfaces, nonlinear physical behavior, discontinuities, or values that require a more specialized interpolation method.
The coordinates use arbitrary consistent units. The calculator cannot know whether your numbers represent meters, pixels, millimeters, map units, or something else. The interpretation depends on the coordinate system you provide.
For engineering, scientific, graphics, or mesh-processing work where small numerical differences matter, verify critical results with your project’s required precision and validation method.
Normalized barycentric coordinates add to \(1\). In a numerical calculator, the displayed values may be rounded, so the visible decimals may add to something like \(0.999999\) or \(1.000001\). That small difference is usually just rounding or floating-point error.
A negative weight usually means the point is outside the triangle, on the side opposite that vertex. For example, if \(\lambda_A\) is negative, the point lies outside across edge \(BC\) in the signed-area sense. The coordinate is still meaningful; it is a location and extrapolation signal, not a broken result.
Ordinary areas are always nonnegative, so they cannot distinguish an inside point from certain outside points. Signed areas keep track of orientation. That sign is what allows barycentric coordinates to classify outside points while still preserving the sum-to-one identity.
For a point inside the triangle, the weights can be read like percentages because they are nonnegative and add to \(1\). For example, \(\lambda_A=0.25\) means a \(25\%\) contribution from vertex \(A\). For outside points, negative or greater-than-one weights are better understood as extrapolation weights, not ordinary percentages.
The same three weights can interpolate many vertex-based quantities, such as height, color channels, texture coordinates, or vector components. This calculator directly reports one scalar interpolated value from \(V_A\), \(V_B\), and \(V_C\) when all three values are supplied. To interpolate multiple channels, apply the same three weights to each channel separately.
A very skinny triangle has a small area compared with its edge lengths. Since the barycentric weights divide by the triangle’s signed area, small coordinate changes or floating-point errors can have a larger effect. Near-boundary classifications are especially sensitive in that situation.
Books
Online and Educational Sources