Barycentric Coordinates Calculator

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.

Barycentric coordinates

Interpolation values

Drag A, B, C, or P in the diagram, or edit the numeric fields directly.

Formula and area interpretation

▼ See explanations and tips below ▼

What Are Barycentric Coordinates?

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

$$ P = \lambda_A A + \lambda_B B + \lambda_C C $$

and

$$ \lambda_A + \lambda_B + \lambda_C = 1. $$

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\).


Why Barycentric Coordinates Matter

Barycentric coordinates turn many triangle problems into weight problems. Once the three weights are known, you can answer questions such as:

  • Is the point inside the triangle, on an edge, at a vertex, or outside?
  • How close is the point to each side of the triangle?
  • What value should be assigned to the point if values are known at the vertices?
  • Does a ray, cursor position, sample point, or mesh point fall within a triangular region?

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.


Key Terms to Know

  • Vertex: One of the triangle’s corner points. In this calculator, the vertices are \(A\), \(B\), and \(C\).
  • Point \(P\): The point being located or classified relative to triangle \(ABC\).
  • Barycentric weight: One of the three values \(\lambda_A\), \(\lambda_B\), and \(\lambda_C\). Each weight belongs to one vertex.
  • Signed area: Triangle area with a sign based on orientation. Reversing the vertex order changes the sign.
  • Double area: Twice the signed area of a triangle. It avoids an unnecessary division by \(2\) when computing ratios.
  • Affine combination: A weighted combination whose weights sum to \(1\).
  • Convex combination: An affine combination whose weights are all nonnegative. Points inside or on a triangle are convex combinations of the triangle’s vertices.
  • Linear interpolation: Estimating a value between known vertex values by taking a weighted average.
  • Extrapolation: Applying the same weighted formula outside the triangle, where one or more weights may fall outside the \(0\) to \(1\) range.

How Barycentric Coordinates Work

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

$$ D(X,Y,Z) = (x_Y-x_X)(y_Z-y_X) - (y_Y-y_X)(x_Z-x_X). $$

The ordinary unsigned area of triangle \(XYZ\) is

$$ \text{Area}(XYZ)=\frac{|D(X,Y,Z)|}{2}. $$

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:

$$ D(A,B,C). $$

The three weights are then

$$ \lambda_A = \frac{D(P,B,C)}{D(A,B,C)}, $$
$$ \lambda_B = \frac{D(P,C,A)}{D(A,B,C)}, $$
$$ \lambda_C = \frac{D(P,A,B)}{D(A,B,C)}. $$

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

$$ V_P = \lambda_A V_A + \lambda_B V_B + \lambda_C V_C. $$

Inside the triangle, this is a weighted average of the vertex values. Outside the triangle, the same formula becomes extrapolation.


Examples of Barycentric Coordinates in Practice

Example 1: Point Inside a Triangle

Suppose the triangle vertices are

$$ A=(0,0), \quad B=(5,0), \quad C=(1,4) $$

and the point is

$$ P=(2,1.2). $$

The signed double area of the full triangle is

$$ D(A,B,C)=(5-0)(4-0)-(0-0)(1-0)=20. $$

So the triangle area is

$$ \frac{|20|}{2}=10. $$

Now compute the opposite signed double areas:

$$ D(P,B,C)=7.2, $$
$$ D(P,C,A)=6.8, $$
$$ D(P,A,B)=6. $$

The barycentric weights are therefore

$$ \lambda_A=\frac{7.2}{20}=0.36, $$
$$ \lambda_B=\frac{6.8}{20}=0.34, $$
$$ \lambda_C=\frac{6}{20}=0.30. $$

They sum to \(1\):

$$ 0.36+0.34+0.30=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:

$$ 0.36(0,0)+0.34(5,0)+0.30(1,4)=(2,1.2). $$

If the vertex values are \(V_A=10\), \(V_B=20\), and \(V_C=35\), the interpolated value is

$$ V_P=0.36(10)+0.34(20)+0.30(35)=20.9. $$

Example 2: Point on an Edge

Use the same triangle, but let

$$ P=(2,0). $$

This point lies on edge \(AB\). The weights are

$$ \lambda_A=0.60, \quad \lambda_B=0.40, \quad \lambda_C=0. $$

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

$$ V_P=0.60(10)+0.40(20)+0(35)=14. $$

Example 3: Point Outside a Triangle

Again use the same triangle, but let

$$ P=(6,1). $$

The weights are

$$ \lambda_A=-0.40, \quad \lambda_B=1.15, \quad \lambda_C=0.25. $$

The weights still sum to \(1\):

$$ -0.40+1.15+0.25=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

$$ V_P=-0.40(10)+1.15(20)+0.25(35)=27.75. $$

Because \(P\) is outside the triangle, this value is an extrapolated result rather than an inside-triangle weighted average.


How to Interpret the Result

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.


Common Mistakes and Misconceptions

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.


When to Use Barycentric Coordinates

Use barycentric coordinates when you need to:

  • Test whether a point lies inside, on, or outside a triangle.
  • Convert a 2D point into weights relative to three triangle vertices.
  • Interpolate a scalar value across a triangular region.
  • Understand how signed subareas relate to point location.
  • Check triangle-based calculations in geometry, graphics, meshes, or finite-element-style interpolation.
  • Debug edge cases involving points on triangle boundaries or just outside a triangle.

Barycentric coordinates are most useful when the region is triangular and the value you want to estimate varies linearly across that triangle.


Limitations and Things to Keep in Mind

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.


How to Use This Calculator

  1. Enter the \(x\) and \(y\) coordinates for triangle vertices \(A\), \(B\), and \(C\).
  2. Enter the \(x\) and \(y\) coordinates for point \(P\), or drag \(P\) on the graph after the first calculation.
  3. Enter the scalar values at \(A\), \(B\), and \(C\) if you want an interpolated value at \(P\).
  4. Use an example preset if you want to load a sample inside, edge, or outside case.
  5. Review \(\lambda_A\), \(\lambda_B\), \(\lambda_C\), the point classification, and the triangle area. When all three scalar values are supplied, also review the interpolated value.
  6. Check the weights table to compare decimal weights, approximate fractions, and oriented opposite subareas.
  7. Use the formula cards and graph to understand how the coordinate identity, area ratios, boundary test, and interpolation formula fit together.
  8. Download the graph as a PNG if you need a copy of the visualization.

Frequently Asked Questions

Do barycentric coordinates always add to 1?

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.


What does a negative barycentric coordinate mean?

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.


Why are signed areas used instead of ordinary areas?

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.


Are barycentric weights the same as percentages?

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.


Can barycentric coordinates interpolate more than one value?

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.


Why does a skinny triangle make results sensitive?

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.


Sources and References

Books

  1. Christer Ericson. Real-Time Collision Detection. Morgan Kaufmann / CRC Press, 2005. Relevant sections used: Chapter 3, especially Section 3.4, “Barycentric Coordinates,” and related triangle primitive-test discussion. Publisher page: https://www.routledge.com/Real-Time-Collision-Detection/Ericson/p/book/9781558607323
  2. Fletcher Dunn and Ian Parberry. 3D Math Primer for Graphics and Game Development. 2nd edition, A K Peters / CRC Press, 2011. Relevant sections used: Chapter 9, “Geometric Primitives,” especially Sections 9.6.3–9.6.4 on barycentric space and calculating barycentric coordinates. Free online edition: https://gamemath.com/book/geomprims.html

Online and Educational Sources

  1. Eric W. Weisstein. “Barycentric Coordinates.” Wolfram MathWorld, accessed June 27, 2026. https://mathworld.wolfram.com/BarycentricCoordinates.html
  2. MIT EECS 6.837 Computer Graphics. “Ray Casting II,” lecture slides by Cutler and Durand, Fall 2004. Relevant slides used: barycentric definition of a triangle and signed-area computation. https://groups.csail.mit.edu/graphics/classes/6.837/F04/lectures/02_RayCasting_II.pdf
  3. Jonathan Richard Shewchuk. “What Is a Good Linear Element? Interpolation, Conditioning, and Quality Measures.” Proceedings of the 11th International Meshing Roundtable, 2002. Relevant sections used: barycentric coordinates as affine combinations, area/volume ratios, linear interpolation, and element-shape sensitivity. https://people.eecs.berkeley.edu/~jrs/papers/elemj.pdf