Maths & numbers
Triangle barycentric coordinates
Express a point as weights of three triangle vertices and check containment.
A clear answer. Here’s how.
Solves planar area-ratio coordinates so P=αA+βB+γC and α+β+γ=1. Requires exactly three non-collinear vertices. Weights in [0,1] indicate an interior/boundary point; negative weights indicate extrapolation outside the triangle, with a 10⁻¹⁰ classification allowance. Coordinates use one Cartesian system. The weights are affine coordinates, not probabilities or confidence values.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Point CSV
X,Y 0,0 4,0 0,3
- Query point X
- 1
- Query point Y
- 1
Example result
| Vertex | Weight |
|---|---|
| A | 0.416666666667 |
| B | 0.25 |
| C | 0.333333333333 |
P = weight A × A + weight B × B + weight C × C; weights sum to one. Point is within or on the triangle.