Main Content

baryToCart

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

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

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

説明

XC = baryToCart(TR,SI,B) は、関連するシンプレックス SI に対する重心座標を表す B の各点の直交座標 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: [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

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 にインデックスするシンプレックス インデックスを含みます。

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

出力引数

すべて折りたたむ

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

詳細

すべて折りたたむ

シンプレックス

シンプレックスは、三角形/四面体、またはより高い次元に相当するものです。

バージョン履歴

R2009a で導入