(Not recommended) Convert point coordinates from barycentric to Cartesian
XC = baryToCart(TR, SI, B)
XC = baryToCart(TR, SI, B) returns the
XC of each point in
represents the barycentric coordinates with respect to its associated
|Column vector of simplex indices that index into the triangulation
|Matrix of cartesian coordinates of the converted points. |
A simplex is a triangle/tetrahedron or higher-dimensional equivalent.
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.
figure subplot(1,2,1); 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.
subplot(1,2,2); triplot(tr); hold on; plot(xc(:,1), xc(:,2), '*r'); hold off; axis equal;