cartToBary
(不推荐)将点坐标从笛卡尔坐标转换为重心坐标
不推荐使用 cartToBary(TriRep)
。请改用 cartesianToBarycentric(triangulation)
。
不推荐使用 TriRep
。请改用 triangulation
。
说明
示例
拉伸三角剖分和映射内心
为一组点创建德劳内一个三角剖分,计算内心的位置,然后拉伸三角剖分并计算变形的三角剖分上内心的映射位置。
计算一个点集的德劳内三角剖分。
x = [0 4 8 12 0 4 8 12]'; y = [0 0 0 0 8 8 8 8]'; dt = DelaunayTri(x,y)
dt = DelaunayTri with properties: X: [8x2 double] Triangulation: [6x3 double] Constraints: []
计算内心的重心坐标。
cc = incenters(dt); tri = dt(:,:);
绘制原始三角剖分和参照点。
subplot(1,2,1) triplot(dt) hold on plot(cc(:,1), cc(:,2), '*r') hold off axis equal
拉伸三角剖分并使用 baryToCart
计算变形的三角剖分上的内心的映射位置。
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);
绘制变形的三角剖分和参照点的映射位置。
subplot(1,2,2) triplot(tr) hold on plot(xc(:,1), xc(:,2), '*r') hold off axis equal
输入参数
TR
— 三角剖分表示法
TriRep
或 DelaunayTri
对象
三角剖分表示,指定为 TriRep
或 DelaunayTri
对象。
SI
— 单纯形索引
列向量
单纯形索引,指定为列向量。SI
包含单纯形索引,这些索引指向三角剖分矩阵 TR.Triangulation
的索引。
XC
— 要转换的笛卡尔坐标
矩阵
要转换的笛卡尔坐标,指定为矩阵。XC
的大小为 m
×n
,其中 n
是三角剖分所在空间的维度。即,点 B(j)
相对于单纯形 SI(j)
的笛卡尔坐标为 XC(j)
。
输出参量
B
— 转换后的点的重心坐标
矩阵
要转换的重心坐标,指定为矩阵。B
是表示点的重心坐标(相对于单纯形 SI
)的矩阵。B
大小为 m
×k
,其中 m
= length(SI)
(即要转换的点数),k
表示每个单纯形的顶点数。
详细信息
单纯形
单纯形是三角形/四面体或更高维度的等效对象。
版本历史记录
在 R2009a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)