1 function [C, G] = aff_trafo_orig2ref(x0, y0, varargin)
2 %
function [C, G] = aff_trafo_orig2ref(x0, y0, varargin)
3 %
function giving the coefficients
for the affine transformation
4 % from original triangle to the reference one,
6 % ``T^{-1}_{i,aff}(x;\mu) = C^{-1}_{i,aff}(\mu) + \sum_{j=1,2} G^{k,-1}_{ij}(\mu) x_j \qquad i=1,2``
9 % triangle: /| (x0(3),y0(3)) (0,1) |\
11 % (x0(1),y0(1)) /__| (x0(2),y0(2)) (0,0) |__\ (1,0)
14 % @deprecated I guess, that
this function is deprecated and
15 % aff_trafo_glob2loc() should be used instead...
17 %
function giving c1, c2, g11, g12, g21, g22
18 % so: C=[c1; c2] and G=[g11, g12; g21, g22]
21 % Oliver Zeeb, 01.02.11
30 ref_coord = [x1; y1; x2; y2; x3; y3];
32 B_aff = [1, 0, x0(1), y0(1), 0, 0; ...
33 0, 1, 0, 0, x0(1), y0(1); ...
34 1, 0, x0(2), y0(2), 0, 0; ...
35 0, 1, 0, 0, x0(2), y0(2); ...
36 1, 0, x0(3), y0(3), 0, 0; ...
37 0, 1, 0, 0, x0(3), y0(3)];
39 coef_vec = B_aff \ ref_coord;
41 C = [coef_vec(1); coef_vec(2)];
42 G = [coef_vec(3), coef_vec(4); coef_vec(5), coef_vec(6)];