跳转到内容

重心坐标

维基百科,自由的百科全书

这是本页的一个历史版本,由刻意留言 | 贡献2008年10月24日 (五) 08:07 新页面,内容:[数学]]中, '''重心坐标''' are coordinates defined by the vertices of a simplex (a triangle, tetrahedron, etc). Barycentric coordinates are a form ...)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

[数学]]中, 重心坐标 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,

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.

三角形的重心坐标

Barycentric coordinates on an equilateral triangle.

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 , and . Any point located on this triangle may then be written as a weighted sum of these three vertices, i.e.

where , and are the area coordinates. These are subjected to the constraint

which means that

Following this, the integral of a function on T is

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 inside a triangle it is also desirable to obtain the area coordinates , and at this point. We can write the barycentric expansion of vector having Cartesian coordinates in terms of the components of the triangle vertices (, , ) as

substituting into the above gives

Rearranging, this is

This linear transformation may be written more succinctly as

Where is the vector of area coordinates, is the vector of Cartesian coordinates, and is a matrix given by

Now the matrix is invertible, since , , and 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 , 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 . If a point lies on an edge of the triangle, at least one of the area coordinates is zero, while the rest lie in the closed interval .

Summarizing,

Point lies inside the triangle iff .
Otherwise, lies on the edge or corner of the triangle if .
Otherwise, 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 at a point , we go through each triangular element and transform into the barycentric coordinates of that triangle. If , then the point lies in the triangle or on its edge (explained in the previous section). Now, we interpolate the value of as

This linear interpolation is automatically normalized since .

四面体的重心坐标

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 maps to barycentric coordinates , , etc.

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

where 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.

参考文献

外部链接