This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Class: TriRep

(Not recommended) Convert point coordinates from Cartesian to barycentric


cartToBary(TriRep) is not recommended. Use cartesianToBarycentric(triangulation) instead.

TriRep is not recommended. Use triangulation instead.


B = cartToBary(TR, SI, XC)


B = cartToBary(TR, SI, XC) returns the barycentric coordinates of each point in XC with respect to its associated simplex SI.

Input Arguments

TRTriangulation representation.
SIColumn vector of simplex indices that index into the triangulation matrix TR.Triangulation.
XCMatrix that represents the Cartesian coordinates of the points to be converted. XC is of size m-by-n, where m is of length(SI), the number of points to convert, and n is the dimension of the space where the triangulation resides.

Output Arguments

BMatrix of dimension m-by-k where k is the number of vertices per simplex.


Compute the Delaunay triangulation of a set of points.

x = [0 4 8 12 0 4 8 12]';
y = [0 0 0 0 8 8 8 8]';
dt = DelaunayTri(x,y)

Compute the barycentric coordinates of the incenters.

cc = incenters(dt);
tri = dt(:,:);

Plot the original triangulation and reference points.

triplot(dt); hold on;
plot(cc(:,1), cc(:,2), '*r'); 
hold off;
axis equal;

Stretch the triangulation and compute the mapped locations of the incenters on the deformed triangulation.

b = cartToBary(dt,[1:length(tri)]',cc);
y = [0 0 0 0 16 16 16 16]';
tr = TriRep(tri,x,y)
xc = baryToCart(tr, [1:length(tri)]', b);

Plot the deformed triangulation and mapped locations of the reference points.

hold on;
plot(xc(:,1), xc(:,2), '*r'); 
hold off;
axis equal;


expand all

Was this topic helpful?