メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

cartToBary

R2026a

(非推奨) 点の座標を直交座標から重心座標に変換

cartToBary(TriRep) は推奨されません。代わりに cartesianToBarycentric(triangulation) を使用してください。

TriRep は推奨されません。代わりに triangulation を使用してください。

説明

B = cartToBary(TR,SI,XC) は、関連するシンプレックス SI に対する XC 内の各点の重心座標を返します。

例

例

すべて折りたたむ

点集合の Delaunay 三角形分割を作成し、内心点の位置を計算します。そして三角形分割を拡大し、変形した三角形分割上のマッピングした内心点の位置を計算します。

点集合の Delaunay 三角形分割を計算します。

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: [8×2 double]
    Triangulation: [6×3 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

Figure contains an axes object. The axes object contains 2 objects of type line. One or more of the lines displays its values using only markers

三角形分割を拡大し、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

Figure contains 2 axes objects. Axes object 1 contains 2 objects of type line. One or more of the lines displays its values using only markers Axes object 2 contains 2 objects of type line. One or more of the lines displays its values using only markers

入力引数

すべて折りたたむ

三角形分割の表現。TriRep オブジェクトまたは DelaunayTri オブジェクトとして指定します。

シンプレックス インデックス。列ベクトルとして指定します。SI は、三角形分割の行列 TR.Triangulation にインデックスするシンプレックス インデックスを含みます。

変換対象の直交座標。行列として指定します。XC は、m 行 n 列のサイズです。ここで、n は三角形分割のある空間の次元です。すなわち、シンプレックス SI(j) に対する点 B(j) の直交座標は XC(j) になります。

出力引数

すべて折りたたむ

変換された点の重心座標。行列として指定します。B は、シンプレックス SI に関連して点の重心座標を表す行列です。B は m 行 k 列のサイズです。ここで m = length(SI) (変換する点の数)、k はシンプレックスごとの頂点の数です。

詳細

すべて折りたたむ

バージョン履歴

R2009a で導入