| n | n-simplex | |
| 0 | point | |
| 1 | line segment | |
| 2 | triangle | |
| 3 | tetrahedron |
Barycentric (bc) coordinates use n+1 reals to locate a point in n-space relative to some n-simplex except that <0, ... 0> does not denote any point. They are redundant for if a≠0 then <x0, ... xn> and <ax0, ... axn> denote the same point. In these pages we demand that ∑xi = 1. We adopt some point in our space as an origin to view it as a vector space. ∑xipi = <x0, ... xn> where {p0, ... pn} are the vertices of the simplex.
The vertices of the simplex have bc coordinates p0 = <1, 0, 0, ...>, p1 = <0, 1, 0, ...>, p2 = <0, 0, 1, ...>, ... pn = <0, 0, 0, ... 1>. If all of the coordinates are positive the point is in the open simplex and conversely.
We will speak of barycentric coordinates (bcc) but suppress the detail of whether we carry n or n+1 numbers as a tactical detail that detracts from geometric presentation. That confusion will certainly plague us later in the code.
If we omit the first component, the basis vectors for the resulting coordinate system are the edges of the simplex that emanate from the first vertex. For 0<j≤n the n vectors pj – p0 form a set of basis vectors for a coordinate system with coordinates x1 ... xn.
These coordinates are in general oblique but there is a particularly simple way to compute the metric tensor for oblique barycentric coördinates from the edge lengths of the simplex. Tricks with the metric tensor, familiar from differential geometry, make doing numerical geometry easy in these coordinates. Here is some code using these ideas to compute dihedral and trihedral angles in arbitrary simplexes.
Contrast Barycentric Coordinates with Trilinear Coordinates.