ToolJoltTools

Barycentric Coordinates Calculator

Express a 2D point as weights of a triangle's vertices — for interpolation, hit-testing and rasterization.

u (weight of A)
v (weight of B)
w (weight of C)

Barycentric coordinates express any point as a weighted blend of the triangle's vertices summing to 1. They power the two pillars of rasterization: the inside test (all weights ≥ 0) and attribute interpolation (blend color/UV/depth/normals by these same weights). Negative weight = outside that edge.

Formula

P = u·A + v·B + w·C with u+v+w = 1 · point is inside the triangle iff all three weights are ≥ 0
References: Möbius (1827), barycentric calculus; Pineda (1988), A Parallel Algorithm for Polygon Rasterization

About Barycentric Coordinates Calculator

Barycentric coordinates express a point as a weighted average of a triangle's three vertices, with the weights summing to one. They're the mathematical core of GPU rasterization: the inside-the-triangle test reduces to 'are all three weights non-negative?', and every per-pixel attribute — color, texture UV, depth, interpolated normals — is computed by blending the vertices' values with these same weights. This calculator computes the barycentric weights of any 2D point relative to a triangle and tells you whether the point lies inside, the exact operation a GPU performs millions of times per frame.

How to use Barycentric Coordinates Calculator

  1. 1Enter your values into Barycentric Coordinates Calculator — sensible, domain-typical defaults are pre-filled so you see a real result immediately.
  2. 2The result recomputes live using the formula shown on the page; there is no button to press.
  3. 3Adjust any input to compare scenarios, then read the worked example to see the substituted numbers.

Why use Barycentric Coordinates Calculator?

  • Computes Barycentric Coordinates instantly in your browser — no sign-up, no upload, no server round-trip.
  • 100% free and unlimited, with the exact formula shown: P = u.
  • Runs entirely client-side, so every value you enter stays private on your device.
  • Live recompute as you type, with a worked example and authoritative references for trust.

Frequently asked questions

How do barycentric coordinates test if a point is in a triangle?+

Compute the three weights; the point is inside the triangle if and only if all three are non-negative (and they always sum to 1). A negative weight means the point is on the far side of the edge opposite that vertex. This is the elegant, branch-light inside test that GPU rasterizers and ray-triangle intersection use.

Why are they used for interpolation in graphics?+

Because they provide the natural blend weights for the triangle's vertices. To find a pixel's color, UV or depth, you take the vertices' values and weight them by the pixel's barycentric coordinates. This gives smooth, linear (affine) interpolation across the face — exactly how Gouraud shading and texture mapping fill triangles between vertex data.

What's perspective-correct interpolation?+

Plain barycentric interpolation in screen space distorts attributes under perspective (textures appear to swim). The fix divides each attribute by its vertex's clip-space w, interpolates, then divides back — 'perspective-correct' interpolation. GPUs do this automatically. Screen-space barycentric weights still drive it; the per-attribute correction handles the foreshortening.

Can barycentric coordinates be negative or exceed 1?+

Yes — for points outside the triangle. Negative means beyond the opposite edge; a weight above 1 means beyond a vertex. They remain a valid affine coordinate system over the whole plane, which is why the simple sign test cleanly separates inside from outside. Inside the triangle, all three lie in [0, 1].

Related tools

Related 3D & VR tools

Sponsored