Expand description
Barycentric and mean-value coordinates, for interpolating values given at the corners of a triangle, a tetrahedron or a polygon (#143).
Every function returns one weight per corner. The weights sum to one and
reproduce the point: sum(w_i * corner_i) == point, up to rounding. A
point on a corner gets weight exactly one there and zero elsewhere, so
corner values are reproduced exactly.
Shapes thinner than the linear tolerance are refused rather than given
weights that are mostly rounding noise; a triangle’s or tetrahedron’s
thinness is its least altitude. Weights outside [0, 1] are not an
error: they place the point outside the triangle or tetrahedron, which is
how callers extrapolate or test containment.
Enums§
- Barycentric
Error - Why coordinates could not be computed.
Functions§
- mean_
value_ coordinates2 - Mean-value coordinates of
pointin a simple polygon, one weight per vertex (Floater 2003, in the form for arbitrary polygons of Hormann and Floater 2006). - tetrahedron_
barycentric - Barycentric coordinates of
pointin a tetrahedron, as weights of its four corners in order. - triangle_
barycentric2 - Barycentric coordinates of
pointin a 2D triangle, as weights ofa,bandc. - triangle_
barycentric3 - Barycentric coordinates of
pointin a 3D triangle, as weights ofa,bandc.