A point on a triangular robot mesh can be stored relative to the triangle's vertices rather than only as a Cartesian coordinate. Three barycentric weights provide that description. The same weights can reconstruct the point and interpolate a scalar attached to the vertices, provided the intended field model is affine across the triangle.
This is a geometric coordinate construction. Its weights are not automatically probabilities, physical contact fractions, or confidence scores. They become meaningful through a specified triangle, vertex order, and interpolation assumption.
Build a triangle with transparent arithmetic
Invent a planar triangle with vertices A = (1, 1), B = (7, 1), and C = (1, 5), all expressed in the same length unit. Its edge vectors from A are B - A = (6, 0) and C - A = (0, 4). The signed doubled area is their determinant, 24; the ordinary area is 12 square units.
For a query P, seek weights lambdaA, lambdaB, and lambdaC satisfying P = lambdaA A + lambdaB B + lambdaC C and lambdaA + lambdaB + lambdaC = 1.
Eliminate lambdaA to write P - A = lambdaB(B - A) + lambdaC(C - A). For this particular triangle, the horizontal and vertical equations separate. LambdaB = (Px - 1)/6 and lambdaC = (Py - 1)/4. LambdaA is whatever remains after subtracting those two from one.
Choose P = (2.5, 2). Its weights are lambdaB = 0.25, lambdaC = 0.25, and lambdaA = 0.50. Reconstruct the coordinates explicitly: the x coordinate is 0.50 times 1 plus 0.25 times 7 plus 0.25 times 1, giving 2.5. The y coordinate similarly gives 2.
Connect the weights to signed areas
CGAL's triangle-coordinate documentation defines each weight as a signed opposite-subtriangle area divided by the parent triangle's signed area. For this interior P, the areas opposite A, B, and C are 6, 3, and 3 square units. Dividing by 12 gives the same weights.
Keeping consistent orientation matters. For a general triangle, determinants recover signed subareas without assuming that edges align with coordinate axes. Replacing all signed areas by absolute areas can hide outside points and break reconstruction.
The nonnegative interior weights sum to one, so they form a convex combination. A point on an edge has a zero weight for the opposite vertex. At vertex A itself, the weights are (1, 0, 0). These conditions describe the closed triangle, including its boundary, rather than only its strict interior.
Use the same weights for an affine field
Assign an invented dimensionless scalar of 10 at A, 22 at B, and 6 at C. An affine interpolation at P is 0.50 times 10 plus 0.25 times 22 plus 0.25 times 6, or 12.
There is a second way to check that result. Moving from A to B changes the scalar by 12 across six horizontal units, giving horizontal slope 2. Moving from A to C changes it by -4 across four vertical units, giving vertical slope -1. The plane is f(x, y) = 10 + 2(x - 1) - (y - 1), equivalently 2x - y + 9. Evaluating it at (2.5, 2) gives 12 again.
The agreement follows from affine reproduction. For any field f(x, y) = ax + by + c, substituting reconstructed coordinates and the sum-to-one condition proves f(P) = lambdaA f(A) + lambdaB f(B) + lambdaC f(C).
This proof does not establish accuracy for an unknown nonlinear field. Three samples determine an affine plane, but many curved fields share the same vertex values. Interpolation is a declared approximation between samples, not a measurement of the unsampled surface.
Outside coordinates still reconstruct a point
Now choose Q = (10, 3). The weights become lambdaB = 1.5, lambdaC = 0.5, and lambdaA = -1. Their sum remains one. Reconstruction gives x = -1 + 10.5 + 0.5 = 10 and y = -1 + 1.5 + 2.5 = 3.
The negative weight identifies an exterior point. Applying the same scalar rule gives -10 + 33 + 3 = 26. That exceeds the largest vertex value, 22, because this is affine extrapolation outside the triangle. The sum-to-one condition alone does not keep a result within the vertex range; nonnegative weights are also required.
Clamping Q's negative weight to zero and renormalizing changes the reconstructed position. It may be useful in a separately defined approximation, but it does not preserve Q's original barycentric representation or necessarily produce the closest point on the triangle.
Carry coordinates through an affine map
Define an invented coordinate transformation F(x, y) = (2x + y + 3, y - 2). It sends A to (6, -1), B to (18, -1), C to (10, 3), and P to (10, 0).
Apply P's original weights to the transformed vertices. The result is (0.50 times 6 plus 0.25 times 18 plus 0.25 times 10, 0.50 times -1 plus 0.25 times -1 plus 0.25 times 3) = (10, 0). The weights survive this invertible affine change because its linear part distributes over the weighted sum and its translation is multiplied by weights summing to one.
This calculation does not cover arbitrary perspective projection. A projective map includes division by a varying coordinate, so reusing screen-space weights for another space requires additional treatment.
Reject degenerate definitions explicitly
If the three vertices are collinear, the area denominator is zero and unique triangle coordinates are unavailable. Nearly collinear vertices can also amplify coordinate errors: in this example the vertical weight divides by height four, while a hypothetical height of 0.001 would amplify the same vertical perturbation much more strongly.
Store vertex order and coordinate frame alongside weights. The example is original analytic work; no geometry library or robot experiment was executed.
Sources checked October 24, 2026: CGAL 6.0, 2D Generalized Barycentric Coordinates user manual: https://doc.cgal.org/6.0/Barycentric_coordinates_2/index.html
Microsoft Learn, D3DXVec2BaryCentric mathematical remarks, updated April 28, 2022: https://learn.microsoft.com/en-us/windows/win32/direct3d10/d3d10-d3dxvec2barycentric
Illustration note: A generic robot vision image supplies conceptual context. It does not show this invented triangle, a reconstructed mesh, or validated interpolation results.