cartToBary

Legacy form of cartesianToBarycentric for TriRep and DelaunayTri objects.

Category: Mathematics > Computational Geometry

Syntax

B = cartToBary(TR, T, X)

Barycentric coordinates of the rows of X relative to the simplices T.

Description

cartToBary is the older name for cartesianToBarycentric and gives the same numbers. Barycentric coordinates are weights on the simplex vertices that add up to 1; negative weights indicate that the point is outside the simplex.

It is retained for scripts that use the DelaunayTri and TriRep classes.

Input arguments

TR
A DelaunayTri or TriRep object.
T
Column vector of simplex indices.
X
Cartesian query points, one per row.

Output arguments

B
Barycentric coordinates, one row per query point.

Example

Barycentric coordinates of a point

x = [0 1 1 0 0.5]';
y = [0 0 1 1 0.5]';
DL = DelaunayTri(x, y);
b = cartToBary(DL, 1, [0.9 0.6])
Output
b = 1×3

    0.2000    0.3000    0.5000

See also

cartesianToBarycentric baryToCart DelaunayTri