www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/BarycentricCoordinatesConvertedtoCartesianCoordinatesExample.m
%% Barycentric Coordinates Converted to Cartesian Coordinates % Copyright 2015 The MathWorks, Inc. %% % Create a triangulation from a set of points, |P|, and triangulation connectivity % list, |T|. P = [ 2.5 8.0 6.5 8.0 2.5 5.0 6.5 5.0 1.0 6.5 8.0 6.5]; T = [5 3 1; 3 2 1; 3 4 2; 4 6 2]; TR = triangulation(T,P); %% % Specify the first triangle. ti = 1; %% % Specify the barycentric coordinates of the second point in the triangle. B = [0 1 0]; %% % Convert the point to Cartesian coordinates. PC = barycentricToCartesian(TR,ti,B)