# Barycentric coordinates

In mathematics, barycentric coordinates are coordinates defined by the vertices of a simplex. Barycentric coordinates are a form of homogeneous coordinates.

Let x1, ..., xn be the vertices of a simplex in a vector space A. If, for some point p in A,

[itex] (a_1 + \cdots + a_n)\, p = a_1 \, x_1 + \cdots + a_n \, x_n [itex]

then we say that the coefficients (a1, ..., an) are barycentric coordinates of p with respect to x1, ..., xn. The vertices themselves have the coordinates (1, 0, 0, ..., 0), (0, 1, 0, ..., 0), ..., (0, 0, 0, ..., 1). Barycentric coordinates are not unique: for any b not equal to zero, (b a1, ..., b an) are also barycentric coordinates of p.

When the coordinates are not negative, the point p lies in the convex hull of x1, ..., xn, that is, in the simplex which has those points as its vertices.

If we imagine masses equal to a1, ..., an attached to the vertices of the simplex, the center of mass (the barycenter) is then p. This is the origin of the term "barycentric", introduced (1827) by August Ferdinand Mbius.

## Barycentric Coordinates on Triangles

Barycentric or area coordinates are extremely useful in engineering applications involving triangular subdomains. These make analytic integrals often easier to evaluate, and Gaussian quadrature tables are often presented in terms of area coordinates.

First let us consider a triangle T defined by three vertices [itex]\textbf{v}_{1}\,[itex], [itex]\textbf{v}_{2}\,[itex] and [itex]\textbf{v}_{3}\,[itex]. Any point [itex]\textbf{r}[itex] located on this triangle may then be written as a weighted sum of these three vertexes, i.e.

[itex]\textbf{r} = \lambda_{1} \textbf{v}_{1} + \lambda_{2} \textbf{v}_{2} + \lambda_{3} \textbf{v}_{3},[itex]

where [itex]\lambda_{1}\,[itex], [itex]\lambda_{2}\,[itex] and [itex]\lambda_{3}\,[itex] are the area coordinates. These are subjected to the constraint

[itex]\lambda_{1} + \lambda_{2} + \lambda_{3} = 1\,[itex]

which means that

[itex]\lambda_{3} = 1 - \lambda_{1} - \lambda_{2}\,[itex]

Following this, the integral of a function [itex]f(\textbf{r})[itex] on T is

[itex]

\int_{T} f(\textbf{r}) \ ds = 2A \int_{0}^{1} \int_{0}^{1 - \lambda_{1}} f(\lambda_{1} \textbf{v}_{1} + \lambda_{2} \textbf{v}_{2} + (1 - \lambda_{1} - \lambda_{2}) \textbf{v}_{3}) \ d\lambda_{1} \ d\lambda_{2} \,[itex]

Note that the above has the form of a linear interpolation. Indeed, area coordinates will also allow us to perform a linear interpolation at all points in the triangle if the values of the function is known at the vertices.

Given a point [itex]\textbf{r}\,[itex] inside a triangle it is also desirable to obtain the area coordinates [itex]\lambda_{1}\,[itex], [itex]\lambda_{2}\,[itex] and [itex]\lambda_{3}\,[itex] at this point. We can write the barycentric expansion of vector [itex]\textbf{r} = (x, y, z)\,[itex] in terms of the components of the triangle vertices as

[itex]

\begin{matrix} x = \lambda_{1} x_{1} + \lambda_{2} x_{2} + \lambda_{3} x_{3} \\ y = \lambda_{1} y_{1} + \lambda_{2} y_{2} + \lambda_{3} y_{3} \\ z = \lambda_{1} z_{1} + \lambda_{2} z_{2} + \lambda_{3} z_{3} \end{matrix} \,[itex]

substituting [itex]\lambda_{3} = 1 - \lambda_{1} - \lambda_{2}\,[itex] into the above gives

[itex]

\begin{matrix} x = \lambda_{1} x_{1} + \lambda_{2} x_{2} + (1 - \lambda_{1} - \lambda_{2}) x_{3} \\ y = \lambda_{1} y_{1} + \lambda_{2} y_{2} + (1 - \lambda_{1} - \lambda_{2}) y_{3} \\ z = \lambda_{1} z_{1} + \lambda_{2} z_{2} + (1 - \lambda_{1} - \lambda_{2}) z_{3} \end{matrix} \,[itex]

Rearranging, this is

[itex]

\begin{matrix} \lambda_{1}(x_{1} - x_{3}) + \lambda_{2}(x_{2} - x_{3}) + x_{3} - x = 0 \\ \lambda_{1}(y_{1} - y_{3}) + \lambda_{2}(y_{2} - y_{3}) + y_{3} - y = 0 \\ \lambda_{1}(z_{1} - z_{3}) + \lambda_{2}(z_{2} - z_{3}) + z_{3} - z = 0 \end{matrix} \,[itex]

solving for [itex]\lambda_{1}\,[itex] and [itex]\lambda_{2}\,[itex] gives us

[itex]

\lambda_{1} = \frac{B(F + I) - C(E + H)}{A(E + H) - B(D + G)} \,[itex]

and

[itex]

\lambda_{2} = \frac{A(F + I) - C(D + G)}{B(D + G) - A(E + H)} \,[itex]

where

[itex]

\begin{matrix} A = x_{1} - x_{3} \\ B = x_{2} - x_{3} \\ C = x_{3} - x \\ D = y_{1} - y_{3} \\ E = y_{2} - y_{3} \\ F = y_{3} - y \\ G = z_{1} - z_{3} \\ H = z_{2} - z_{3} \\ I = z_{3} - z \\ \end{matrix} \,[itex]

• Art and Cultures
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Space and Astronomy