Welcome to destall.com on July 11 2009.
This is an internet experiment running to monitor browsing habbits of individuals through wikipedia contents.

Barycentric coordinates (mathematics)

From Wikipedia, the free encyclopedia

Jump to: navigation, search

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 x1, ..., xn be the vertices of a simplex in a vector space A. If, for some point p in A,

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

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 Möbius.

See also ternary plot.

Contents

[edit] Barycentric coordinates on triangles

Barycentric coordinates 123) on an equilateral triangle.

In the context of a triangle, barycentric coordinates are also known as area 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 \textbf{v}_{1}\,, \textbf{v}_{2}\, and \textbf{v}_{3}\,. Any point \textbf{r} located on this triangle may then be written as a weighted sum of these three vertices, i.e.

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

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

\lambda_{1} + \lambda_{2} + \lambda_{3} = 1\,

which means that

\lambda_{3} = 1 - \lambda_{1} - \lambda_{2}\,

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


\int_{T} f(\textbf{r}) \ dr = 2A \int_{0}^{1} \int_{0}^{1 - \lambda_{2}} 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}
\,

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.

[edit] Converting to barycentric coordinates

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


\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} \\
\end{matrix}
\,

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


\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} \\
\end{matrix}
\,

Rearranging, this is


\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 \\
\end{matrix}
\,

This linear transformation may be written more succinctly as


\textbf{T} \cdot \lambda = \textbf{r}-\textbf{r}_3
\,

Where λ is the vector of barycentric coordinates, \textbf{r} is the vector of Cartesian coordinates, and \textbf{T} is a matrix given by


\textbf{T} = \left(\begin{matrix}
x_1-x_3 & x_2-x_3 \\
y_1-y_3 & y_2-y_3 \\
\end{matrix}\right)

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


\left(\begin{matrix}\lambda_1 \\ \lambda_2\end{matrix}\right) = \textbf{T}^{-1} ( \textbf{r}-\textbf{r}_3 )
\,

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


[edit] 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 (0,1). If a point lies on an edge of the triangle, at least one of the area coordinates λ1...3 is zero, while the rest lie in the closed interval [0,1].

Summarizing,

Point \textbf{r} lies inside the triangle iff 0 < \lambda_i < 1 \;\forall\; i \text{ in } 1,2,3.
Otherwise, \textbf{r} lies on the edge or corner of the triangle if 0 \leq \lambda_i \leq 1 \;\forall\; i \text{ in } 1,2,3.
Otherwise, \textbf{r} lies outside the triangle.

[edit] 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 \textbf{r}, we go through each triangular element and transform \textbf{r} into the barycentric coordinates of that triangle. If 0 \leq \lambda_i \leq 1 \;\forall\; i \text{ in } 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(\textbf{r}) as

f(\textbf{r}) = \lambda_1 f(\textbf{r}_1) + \lambda_2 f(\textbf{r}_2) + \lambda_3 f(\textbf{r}_3)

This linear interpolation is automatically normalized since λ1 + λ2 + λ3 = 1.

[edit] 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 \textbf{r}_1 maps to barycentric coordinates λ = (1,0,0,0), \textbf{r}_2 \to (0,1,0,0), etc.

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


\left(\begin{matrix}\lambda_1 \\ \lambda_2 \\ \lambda_3\end{matrix}\right) = \textbf{T}^{-1} ( \textbf{r}-\textbf{r}_4 )
\,

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


\textbf{T} = \left(\begin{matrix}
x_1-x_4 & x_2-x_4 & x_3-x_4\\
y_1-y_4 & y_2-y_4 & y_3-y_4\\
z_1-z_4 & z_2-z_4 & z_3-z_4
\end{matrix}\right)

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.

[edit] Generalized barycentric coordinates

Barycentric coordinates (a1, ..., an) that are defined with respect to a polytope instead of a simplex are called generalized barycentric coordinates. For these, the equation

(a_1 + ... + a_n) \cdot p = a_1 x_1 + ... + a_n x_n

is still required to hold where x1, ..., xn are the vertices of the given polytope. Thus, the definition is formally unchanged but while a simplex with n vertices needs to be embedded in a vector space of dimension of at least n-1, a polytope may be embedded in a vector space of lower dimension. The simplest example is a quadrilateral in the plane. Consequently, even normalized generalized barycentric coordinates (i.e. coordinates such that the sum of the coefficients is 1) are in general not uniquely determined anymore while this is the case for normalized barycentric coordinates with respect to a simplex.

Generalized barycentric coordinates have applications in computer graphics and more specifically in geometric modelling. Often, a three-dimensional model can be approximated by a polyhedron such that the generalized barycentric coordinates with respect to that polyhedron have a geometric meaning. In this way, the processing of the model can be simplified by using these meaningful coordinates.

[edit] References

[edit] External links

Personal tools

Visit joltnews for the latest headlines
Visit bloit.com for company information
Geed Media does computer consulting on long island.
This page viewed times. See Logs