Barycentric Coordinates and Triangle Interpolation
Express a point as an affine combination of triangle corners and detect when interpolation becomes numerically sensitive.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Three weights reproduce position and sum to one
For noncollinear \(a,b,c\), solve \(p=\lambda_a a+\lambda_b b+\lambda_c c\) with \(\lambda_a+\lambda_b+\lambda_c=1\). Subtracting \(a\) gives a two-by-two linear system in \(\lambda_b,\lambda_c\). At \(a=(0,0),b=(1,0),c=(0,1),p=(1/4,1/2)\), weights are \((1/4,1/4,1/2)\). For a point inside or on the triangle all three are nonnegative. Each coordinate also agrees with a ratio of signed triangle areas.
Attribute interpolation inherits the geometry’s conditioning
Interpolate a scalar attribute using the same weighted sum of corner values. A nearly collinear triangle has a small area determinant, potentially making weights very sensitive to small position errors. Exact orientation can still classify the represented geometry while interpolation needs care about precision. Condition numbers explain sensitivity of the two-by-two solve. Perspective-correct interpolation changes the weights used after projection.[1][2]