Barycentric coordinates (mathematics)

﻿
Barycentric coordinates (mathematics)

In mathematics, barycentric coordinates are coordinates defined by the vertices of a simplex (a triangle, tetrahedron, etc). Barycentric coordinates are a form of homogeneous coordinates.

Let "x"1, ..., "x""n" be the vertices of a simplex in a vector space "A". If, for some point "p" in "A",

:$\left(a_1 + cdots + a_n\right), p = a_1 , x_1 + cdots + a_n , x_n$

then we say that the coefficients ("a"1, ..., "a""n") are "barycentric coordinates" of "p" with respect to "x"1, ..., "x""n". 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 a"1, ..., "b a""n") are also barycentric coordinates of "p".

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

If we imagine masses equal to "a"1, ..., "a""n" 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 Möbius.

Barycentric coordinates on triangles

In the context of a triangle, barycentric coordinates are also known as areal coordinates, because the coordinates of "P" with respect to triangle "ABC" are proportional to the (signed) areas of "PBC", "PCA" and "PAB". Areal and trilinear coordinates are used for similar purposes in geometry.

Barycentric or areal 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 $extbf\left\{v\right\}_\left\{1\right\},$, $extbf\left\{v\right\}_\left\{2\right\},$ and $extbf\left\{v\right\}_\left\{3\right\},$. Any point $extbf\left\{r\right\}$ located on this triangle may then be written as a weighted sum of these three vertices, i.e.

:$extbf\left\{r\right\} = lambda_\left\{1\right\} extbf\left\{v\right\}_\left\{1\right\} + lambda_\left\{2\right\} extbf\left\{v\right\}_\left\{2\right\} + lambda_\left\{3\right\} extbf\left\{v\right\}_\left\{3\right\},$

where $lambda_\left\{1\right\},$, $lambda_\left\{2\right\},$ and $lambda_\left\{3\right\},$ are the area coordinates. These are subjected to the constraint

:$lambda_\left\{1\right\} + lambda_\left\{2\right\} + lambda_\left\{3\right\} = 1,$

which means that

:$lambda_\left\{3\right\} = 1 - lambda_\left\{1\right\} - lambda_\left\{2\right\},$

Following this, the integral of a function $f\left( extbf\left\{r\right\}\right)$ on T is:$int_\left\{T\right\} f\left( extbf\left\{r\right\}\right) ds = 2A int_\left\{0\right\}^\left\{1\right\} int_\left\{0\right\}^\left\{1 - lambda_\left\{2 f\left(lambda_\left\{1\right\} extbf\left\{v\right\}_\left\{1\right\} + lambda_\left\{2\right\} extbf\left\{v\right\}_\left\{2\right\} +\left(1 - lambda_\left\{1\right\} - lambda_\left\{2\right\}\right) extbf\left\{v\right\}_\left\{3\right\}\right) dlambda_\left\{1\right\} dlambda_\left\{2\right\},$

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 are known at the vertices.

Converting to barycentric coordinates

Given a point $extbf\left\{r\right\},$ inside a triangle it is also desirable to obtain the area coordinates $lambda_\left\{1\right\},$, $lambda_\left\{2\right\},$ and $lambda_\left\{3\right\},$ at this point. We can write the barycentric expansion of vector $extbf\left\{r\right\}$ having Cartesian coordinates $\left(x, y\right),$ in terms of the components of the triangle vertices ($extbf\left\{r\right\}_1$, $extbf\left\{r\right\}_2$, $extbf\left\{r\right\}_3$) as

:

substituting $lambda_\left\{3\right\} = 1 - lambda_\left\{1\right\} - lambda_\left\{2\right\},$ into the above gives

:

Rearranging, this is

:

This linear transformation may be written more succinctly as

:$extbf\left\{T\right\} cdot lambda = extbf\left\{r\right\}- extbf\left\{r\right\}_3,$

Where $lambda$ is the vector of area coordinates, $extbf\left\{r\right\}$ is the vector of Cartesian coordinates, and $extbf\left\{T\right\}$ is a matrix given by

:

Now the matrix $extbf\left\{T\right\}$ is invertible, since $extbf\left\{r\right\}_1$, $extbf\left\{r\right\}_2$, and $extbf\left\{r\right\}_3$ are linearly independent (if this was not the case, they would be colinear and would not form a triangle). Thus, we can rearrange the above equation to get

:

Finding the barycentric coordinates has thus been reduced to finding the inverse matrix of $extbf\left\{T\right\}$, a trivial problem in the case of 2×2 matrices.

Determining if a point is inside a triangle

Since barycentric coordinates are a linear transformation of Cartesian coordinates, it follows that they vary linearly along the edges and over the area of the triangle. If a point lies in the interior of the triangle, all of the Barycentric coordinates lie in the open interval $\left(0,1\right)$. If a point lies on an "edge" of the triangle, at least one of the area coordinates $lambda_\left\{1...3\right\}$ is zero, while the rest lie in the closed interval $\left[0,1\right]$.

Summarizing,:Point $extbf\left\{r\right\}$ lies inside the triangle iff $0 < lambda_i < 1 ;forall; i ext\left\{ in \right\} 1,2,3$.:Otherwise, $extbf\left\{r\right\}$ lies on the edge or corner of the triangle if $0 leq lambda_i leq 1 ;forall; i ext\left\{ in \right\} 1,2,3$.:Otherwise, $extbf\left\{r\right\}$ lies outside the triangle.

Interpolation on a triangular unstructured grid

Barycentric coordinates provide a convenient way to interpolate a function on an unstructured grid or mesh, as long as the function's value is known at all vertices of the mesh.

To interpolate a function $f$ at a point $extbf\left\{r\right\}$, we go through each triangular element and transform $extbf\left\{r\right\}$ into the barycentric coordinates of that triangle. If $0 leq lambda_i leq 1 ;forall; i ext\left\{ in \right\} 1,2,3$, then the point lies in the triangle or on its edge (explained in the previous section). Now, we interpolate the value of $f\left( extbf\left\{r\right\}\right)$ as

:$f\left( extbf\left\{r\right\}\right) = lambda_1 f\left( extbf\left\{r\right\}_1\right) + lambda_2 f\left( extbf\left\{r\right\}_2\right) + lambda_3 f\left( extbf\left\{r\right\}_3\right)$

This linear interpolation is automatically normalized since $lambda_1+lambda_2+lambda_3=1$.

Barycentric coordinates on tetrahedra

Barycentric coordinates may be easily extended to three dimensions. The 3D simplex is a tetrahedron, a polyhedron having four triangular faces and four vertices. Once again, the barycentric coordinates are defined so that the first vertex $extbf\left\{r\right\}_1$ maps to barycentric coordinates $lambda = \left(1,0,0,0\right)$, $extbf\left\{r\right\}_2 o \left(0,1,0,0\right)$, etc.

This is again a linear transformation, and we may extend the above procedure for triangles to find the barycentric coordinates of a point $extbf\left\{r\right\}$ with respect to a tetrahedron:

:

where $mathbf\left\{T\right\}$ is now a 3×3 matrix:

:

Once again, the problem of finding the barycentric coordinates has been reduced to inverting a 3×3 matrix. 3D barycentric coordinates may be used to decide if a point lies inside a tetrahedral volume, and to interpolate a function within a tetrahedral mesh, in an analogous manner to the 2D procedure. Tetrahedral meshes are often used in finite element analysis because the use of barycentric coordinates can greatly simplify 3D interpolation.

References

*
*
*

* [http://www.cut-the-knot.org/triangle/glasses.shtml Barycentric coordinates: A Curious Application] "(solving the "three glasses" problem)" at cut-the-knot
* [http://www.math.fau.edu/yiu/barycentricpaper.pdf The uses of homogeneous barycentric coordinates in plane euclidean geometry]

Wikimedia Foundation. 2010.

Look at other dictionaries:

• Barycentric — can refer to:In astronomy, * Barycentric coordinates (astronomy) are coordinates defined by the common center of mass of two or more bodies * Barycentric Dynamical Time was a time standard in the Solar system * Barycentric Coordinate Time is a… …   Wikipedia

• List of mathematics articles (B) — NOTOC B B spline B* algebra B* search algorithm B,C,K,W system BA model Ba space Babuška Lax Milgram theorem Baby Monster group Baby step giant step Babylonian mathematics Babylonian numerals Bach tensor Bach s algorithm Bachmann–Howard ordinal… …   Wikipedia

• Homogeneous coordinates — In mathematics, homogeneous coordinates, introduced by August Ferdinand Möbius in his 1827 work Der barycentrische Calcul [ [http://www history.mcs.st andrews.ac.uk/Biographies/Mobius.html Mobius biography ] ] , allow affine transformations to be …   Wikipedia

• Coordinate system — For geographical coordinates on Wikipedia, see Wikipedia:WikiProject Geographical coordinates. In geometry, a coordinate system is a system which uses one or more numbers, or coordinates, to uniquely determine the position of a point or other… …   Wikipedia

• List of triangle topics — This list of triangle topics includes things related to the geometric shape, either abstractly, as in idealizations studied by geometers, or in triangular arrays such as Pascal s triangle or triangular matrices, or concretely in physical space.… …   Wikipedia

• Polygon (computer graphics) — Polygons are used in computer graphics to compose images that are three dimensional in appearance. Usually (but not always) triangular, polygons arise when an object s surface is modeled, vertices are selected, and the object is rendered in a… …   Wikipedia