An n-simplex is the convex hull of n+1 points that do not all lie in some n–1 dimensional space. The n+1 points are its vertices.
nn-simplex
0point
1line segment
2triangle
3tetrahedron

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.

We may use bcc to denote velocity. We view velocity as the time derivative of position. It the coordinates of the moving point are pi then ∂pi/∂t denote the velocity. While ∑pi = 1, ∑(∂pi/∂t) = ∂(∑pi)/∂t = ∂1/∂t = 0. Interpreting a set of n+1 numbers to know a position or velocity must avoid the following confusion. Since they are redundant one of the numbers is normally discarded. If the ith component is ignored then the n basis vectors constituted by edges meeting vertex i, with origin there must be used. If a velocity is represented then each edge meting vertex i must be taken as a member of the basis set that spans the vector space of velocities. For redundant velocity coordinates, coordinate j be taken as a rate that the point is receding from facet j, normalized to altitude j of the zone.

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.