diff options
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/fact')
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m | 25 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m | 25 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/factor.m | 50 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/factor_test.m | 52 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/factor_test2.m | 52 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/factorizaion.tar | bin | 0 -> 81920 bytes | |||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/findG.m | 48 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/findg1.m | 49 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/findg2.m | 56 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/hotel.mat | bin | 0 -> 56320 bytes | |||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/show_3dpoints.m | 22 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/show_S.m | 17 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/show_t.m | 10 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/show_t3.m | 10 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/zt.m | 6 |
15 files changed, 422 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m new file mode 100755 index 0000000..372b4b6 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m | |||
@@ -0,0 +1,25 @@ | |||
1 | function W = construct_w(centers,Ds,img_center,indexes,frames) | ||
2 | % | ||
3 | % function W = construct_w(centers,Ds,img_center,indexes,frames) | ||
4 | % optional: frames | ||
5 | % | ||
6 | |||
7 | |||
8 | points = length(indexes); | ||
9 | if (nargin == 4), | ||
10 | frames = 0.5*size(centers,2); | ||
11 | end | ||
12 | |||
13 | W = zeros(2*frames,points); | ||
14 | |||
15 | center_x = img_center(1); | ||
16 | center_y = img_center(2); | ||
17 | |||
18 | for j=1:frames, | ||
19 | % x is centers(:,2*j-1) | ||
20 | % y is centers(:,2*j) | ||
21 | % d is Ds(:,2*j-1) | ||
22 | W(j,:) = (centers(indexes,2*j-1) -center_x)'./Ds(indexes,2*j-1)'; | ||
23 | W(j+frames,:) = (centers(indexes,2*j) -center_y)'./Ds(indexes,2*j-1)'; | ||
24 | % W(j+2*frames,:) = ones(1,points)./Ds(indexes,2*j-1)'; | ||
25 | end \ No newline at end of file | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m new file mode 100755 index 0000000..b2939b7 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m | |||
@@ -0,0 +1,25 @@ | |||
1 | function W = construct_w2(centers,Ds,img_center,indexes,frames) | ||
2 | % | ||
3 | % function W = construct_w2(centers,Ds,img_center,indexes,frames) | ||
4 | % optional: frames | ||
5 | % | ||
6 | |||
7 | |||
8 | points = length(indexes); | ||
9 | if (nargin == 4), | ||
10 | frames = 0.5*size(centers,2); | ||
11 | end | ||
12 | |||
13 | W = zeros(3*frames,points); | ||
14 | |||
15 | center_x = img_center(1); | ||
16 | center_y = img_center(2); | ||
17 | |||
18 | for j=1:frames, | ||
19 | % x is centers(:,2*j-1) | ||
20 | % y is centers(:,2*j) | ||
21 | % d is Ds(:,2*j-1) | ||
22 | W(j,:) = (centers(indexes,2*j-1) -center_x)'./Ds(indexes,2*j-1)'; | ||
23 | W(j+frames,:) = (centers(indexes,2*j) -center_y)'./Ds(indexes,2*j-1)'; | ||
24 | W(j+2*frames,:) = ones(1,points)./Ds(indexes,2*j-1)'; | ||
25 | end \ No newline at end of file | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/factor.m b/SD-VBS/common/toolbox/toolbox_basic/fact/factor.m new file mode 100755 index 0000000..635c29a --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/factor.m | |||
@@ -0,0 +1,50 @@ | |||
1 | % | ||
2 | % Usage: | ||
3 | % | ||
4 | % [R,t,S] = factor(W) | ||
5 | % | ||
6 | % Function to factor a matrix of input data (W) into the camera | ||
7 | % rotation matrix (R), translation (t), and the shape matrix (S). | ||
8 | % Three-dimensional version. Failure of normalization results in | ||
9 | % empty R and S. | ||
10 | |||
11 | function [R,t,S] = factor(W) | ||
12 | |||
13 | pts = size(W,2); | ||
14 | t = W*ones(pts,1)/pts; | ||
15 | W = W - t*ones(1,pts); | ||
16 | |||
17 | % Use SVD to factor W. | ||
18 | [a,b,c] = svd(W,0); | ||
19 | |||
20 | smallb = b(1:3,1:3); % Since W is rank 3, b has only three meaningful values | ||
21 | sqrtb = sqrt(smallb); | ||
22 | Rhat = a(:,1:3) * sqrtb; | ||
23 | Shat = sqrtb * c(:,1:3)'; | ||
24 | |||
25 | G = findG(Rhat); | ||
26 | |||
27 | if size(G,1) == 0, | ||
28 | R = []; | ||
29 | S = []; | ||
30 | else | ||
31 | R = Rhat*G; | ||
32 | S = inv(G)*Shat; | ||
33 | |||
34 | % rotation matrix that aligns the reference frame with the first camera | ||
35 | F = size(R,1)/2; | ||
36 | R1 = R(1,:); | ||
37 | R1 = R1/norm(R1); | ||
38 | R2 = R(F+1,:); | ||
39 | R2 = R2/norm(R2); | ||
40 | R3 = cross(R1,R2); | ||
41 | R3 = R3/norm(R3); | ||
42 | P = [R1; R2; R3]; | ||
43 | P = P'; | ||
44 | |||
45 | R = R*P; | ||
46 | S = inv(P)*S; | ||
47 | end | ||
48 | |||
49 | |||
50 | |||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/factor_test.m b/SD-VBS/common/toolbox/toolbox_basic/fact/factor_test.m new file mode 100755 index 0000000..12ceb95 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/factor_test.m | |||
@@ -0,0 +1,52 @@ | |||
1 | % | ||
2 | % Usage: | ||
3 | % | ||
4 | % [R,t,S] = factor(W) | ||
5 | % | ||
6 | % Function to factor a matrix of input data (W) into the camera | ||
7 | % rotation matrix (R), translation (t), and the shape matrix (S). | ||
8 | % Three-dimensional version. Failure of normalization results in | ||
9 | % empty R and S. | ||
10 | |||
11 | function [R,t,S,C,b] = factor(W) | ||
12 | |||
13 | pts = size(W,2); | ||
14 | t = W*ones(pts,1)/pts; | ||
15 | W = W - t*ones(1,pts); | ||
16 | |||
17 | % Use SVD to factor W. | ||
18 | [a,b,c] = svd(W,0); | ||
19 | |||
20 | figure(3);plot(diag(b)) | ||
21 | |||
22 | smallb = b(1:3,1:3); % Since W is rank 3, b has only three meaningful values | ||
23 | sqrtb = sqrt(smallb); | ||
24 | Rhat = a(:,1:3) * sqrtb; | ||
25 | Shat = sqrtb * c(:,1:3)'; | ||
26 | |||
27 | [G,C] = findg1(Rhat); | ||
28 | |||
29 | if size(G,1) == 0, | ||
30 | R = []; | ||
31 | S = []; | ||
32 | else | ||
33 | R = Rhat*G; | ||
34 | S = inv(G)*Shat; | ||
35 | |||
36 | % rotation matrix that aligns the reference frame with the first camera | ||
37 | F = size(R,1)/2; | ||
38 | R1 = R(1,:); | ||
39 | R1 = R1/norm(R1); | ||
40 | R2 = R(F+1,:); | ||
41 | R2 = R2/norm(R2); | ||
42 | R3 = cross(R1,R2); | ||
43 | R3 = R3/norm(R3); | ||
44 | P = [R1; R2; R3]; | ||
45 | P = P'; | ||
46 | |||
47 | R = R*P; | ||
48 | S = inv(P)*S; | ||
49 | end | ||
50 | |||
51 | |||
52 | |||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/factor_test2.m b/SD-VBS/common/toolbox/toolbox_basic/fact/factor_test2.m new file mode 100755 index 0000000..3520122 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/factor_test2.m | |||
@@ -0,0 +1,52 @@ | |||
1 | % | ||
2 | % Usage: | ||
3 | % | ||
4 | % [R,t,S] = factor(W) | ||
5 | % | ||
6 | % Function to factor a matrix of input data (W) into the camera | ||
7 | % rotation matrix (R), translation (t), and the shape matrix (S). | ||
8 | % Three-dimensional version. Failure of normalization results in | ||
9 | % empty R and S. | ||
10 | |||
11 | function [R,t,S,C,b] = factor(W) | ||
12 | |||
13 | pts = size(W,2); | ||
14 | t = W*ones(pts,1)/pts; | ||
15 | W = W - t*ones(1,pts); | ||
16 | |||
17 | % Use SVD to factor W. | ||
18 | [a,b,c] = svd(W,0); | ||
19 | |||
20 | figure(3);plot(diag(b)) | ||
21 | |||
22 | smallb = b(1:3,1:3); % Since W is rank 3, b has only three meaningful values | ||
23 | sqrtb = sqrt(smallb); | ||
24 | Rhat = a(:,1:3) * sqrtb; | ||
25 | Shat = sqrtb * c(:,1:3)'; | ||
26 | |||
27 | [G,C] = findg2(Rhat); | ||
28 | |||
29 | if size(G,1) == 0, | ||
30 | R = []; | ||
31 | S = []; | ||
32 | else | ||
33 | R = Rhat*G; | ||
34 | S = inv(G)*Shat; | ||
35 | |||
36 | % rotation matrix that aligns the reference frame with the first camera | ||
37 | F = size(R,1)/2; | ||
38 | R1 = R(1,:); | ||
39 | R1 = R1/norm(R1); | ||
40 | R2 = R(F+1,:); | ||
41 | R2 = R2/norm(R2); | ||
42 | R3 = cross(R1,R2); | ||
43 | R3 = R3/norm(R3); | ||
44 | P = [R1; R2; R3]; | ||
45 | P = P'; | ||
46 | |||
47 | R = R*P; | ||
48 | S = inv(P)*S; | ||
49 | end | ||
50 | |||
51 | |||
52 | |||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/factorizaion.tar b/SD-VBS/common/toolbox/toolbox_basic/fact/factorizaion.tar new file mode 100755 index 0000000..133cdff --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/factorizaion.tar | |||
Binary files differ | |||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/findG.m b/SD-VBS/common/toolbox/toolbox_basic/fact/findG.m new file mode 100755 index 0000000..9a6bd73 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/findG.m | |||
@@ -0,0 +1,48 @@ | |||
1 | function G = find3G(Rhat) | ||
2 | |||
3 | % number of frames | ||
4 | F = size(Rhat,1)/2; | ||
5 | |||
6 | % Build matrix Q such that Q * v = [1,...,1,0,...,0] where v is a six | ||
7 | % element vector containg all six distinct elements of the Matrix C | ||
8 | |||
9 | clear Q | ||
10 | for f = 1:F, | ||
11 | g = f + F; | ||
12 | h = g + F; | ||
13 | Q(f,:) = zt(Rhat(f,:), Rhat(f,:)); | ||
14 | Q(g,:) = zt(Rhat(g,:), Rhat(g,:)); | ||
15 | Q(h,:) = zt(Rhat(f,:), Rhat(g,:)); | ||
16 | end | ||
17 | |||
18 | % Solve for v | ||
19 | rhs = [ones(2*F,1); zeros(F,1)]; | ||
20 | v = Q \ rhs; | ||
21 | |||
22 | % C is a symmetric 3x3 matrix such that C = G * transpose(G) | ||
23 | C(1,1) = v(1); | ||
24 | C(1,2) = v(2); | ||
25 | C(1,3) = v(3); | ||
26 | C(2,2) = v(4); | ||
27 | C(2,3) = v(5); | ||
28 | C(3,3) = v(6); | ||
29 | C(2,1) = C(1,2); | ||
30 | C(3,1) = C(1,3); | ||
31 | C(3,2) = C(2,3); | ||
32 | |||
33 | e = eig(C); | ||
34 | disp(e) | ||
35 | |||
36 | if (any(e<= 0)), | ||
37 | G = []; | ||
38 | else | ||
39 | G = sqrtm(C); | ||
40 | end | ||
41 | |||
42 | %neg = 0; | ||
43 | %if e(1) <= 0, neg = 1; end | ||
44 | %if e(2) <= 0, neg = 1; end | ||
45 | %if e(3) <= 0, neg = 1; end | ||
46 | %if neg == 1, G = []; | ||
47 | %else G = sqrtm(C); | ||
48 | %end | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/findg1.m b/SD-VBS/common/toolbox/toolbox_basic/fact/findg1.m new file mode 100755 index 0000000..f14ecc6 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/findg1.m | |||
@@ -0,0 +1,49 @@ | |||
1 | function [G,C] = find3G(Rhat) | ||
2 | |||
3 | % number of frames | ||
4 | F = size(Rhat,1)/2; | ||
5 | |||
6 | % Build matrix Q such that Q * v = [1,...,1,0,...,0] where v is a six | ||
7 | % element vector containg all six distinct elements of the Matrix C | ||
8 | |||
9 | clear Q | ||
10 | for f = 1:F, | ||
11 | g = f + F; | ||
12 | h = g + F; | ||
13 | Q(f,:) = zt(Rhat(f,:), Rhat(f,:)); | ||
14 | Q(g,:) = zt(Rhat(g,:), Rhat(g,:)); | ||
15 | Q(h,:) = zt(Rhat(f,:), Rhat(g,:)); | ||
16 | end | ||
17 | |||
18 | % Solve for v | ||
19 | rhs = [ones(2*F,1); zeros(F,1)]; | ||
20 | v = Q \ rhs; | ||
21 | |||
22 | % C is a symmetric 3x3 matrix such that C = G * transpose(G) | ||
23 | C(1,1) = v(1); | ||
24 | C(1,2) = v(2); | ||
25 | C(1,3) = v(3); | ||
26 | C(2,2) = v(4); | ||
27 | C(2,3) = v(5); | ||
28 | C(3,3) = v(6); | ||
29 | C(2,1) = C(1,2); | ||
30 | C(3,1) = C(1,3); | ||
31 | C(3,2) = C(2,3); | ||
32 | |||
33 | e = eig(C); | ||
34 | disp(e) | ||
35 | |||
36 | if (any(e<= 0)), | ||
37 | C = C -2*min(e)*eye(3); | ||
38 | G = sqrtm(C); | ||
39 | else | ||
40 | G = sqrtm(C); | ||
41 | end | ||
42 | |||
43 | %neg = 0; | ||
44 | %if e(1) <= 0, neg = 1; end | ||
45 | %if e(2) <= 0, neg = 1; end | ||
46 | %if e(3) <= 0, neg = 1; end | ||
47 | %if neg == 1, G = []; | ||
48 | %else G = sqrtm(C); | ||
49 | %end | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/findg2.m b/SD-VBS/common/toolbox/toolbox_basic/fact/findg2.m new file mode 100755 index 0000000..5a84b86 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/findg2.m | |||
@@ -0,0 +1,56 @@ | |||
1 | function [G,C] = find3G(Rhat) | ||
2 | |||
3 | % number of frames | ||
4 | F = size(Rhat,1)/3; | ||
5 | |||
6 | % Build matrix Q such that Q * v = [1,...,1,0,...,0] where v is a six | ||
7 | % element vector containg all six distinct elements of the Matrix C | ||
8 | |||
9 | clear Q | ||
10 | for f = 1:F, | ||
11 | g = f + F; | ||
12 | h = g + F; | ||
13 | j = h + F; | ||
14 | k = j + F; | ||
15 | l = k + F; | ||
16 | Q(f,:) = zt(Rhat(f,:), Rhat(f,:)); | ||
17 | Q(g,:) = zt(Rhat(g,:), Rhat(g,:)); | ||
18 | Q(h,:) = zt(Rhat(h,:), Rhat(h,:)); | ||
19 | Q(j,:) = zt(Rhat(f,:), Rhat(g,:)); | ||
20 | Q(k,:) = zt(Rhat(f,:), Rhat(h,:)); | ||
21 | Q(l,:) = zt(Rhat(g,:), Rhat(h,:)); | ||
22 | end | ||
23 | |||
24 | % Solve for v | ||
25 | rhs = [ones(3*F,1); zeros(3*F,1)]; | ||
26 | v = Q \ rhs; | ||
27 | |||
28 | % C is a symmetric 3x3 matrix such that C = G * transpose(G) | ||
29 | C(1,1) = v(1); | ||
30 | C(1,2) = v(2); | ||
31 | C(1,3) = v(3); | ||
32 | C(2,2) = v(4); | ||
33 | C(2,3) = v(5); | ||
34 | C(3,3) = v(6); | ||
35 | C(2,1) = C(1,2); | ||
36 | C(3,1) = C(1,3); | ||
37 | C(3,2) = C(2,3); | ||
38 | |||
39 | e = eig(C); | ||
40 | disp(e) | ||
41 | |||
42 | |||
43 | if (any(e<= 0)), | ||
44 | C = C -2*min(e)*eye(3); | ||
45 | G = sqrtm(C); | ||
46 | else | ||
47 | G = sqrtm(C); | ||
48 | end | ||
49 | |||
50 | %neg = 0; | ||
51 | %if e(1) <= 0, neg = 1; end | ||
52 | %if e(2) <= 0, neg = 1; end | ||
53 | %if e(3) <= 0, neg = 1; end | ||
54 | %if neg == 1, G = []; | ||
55 | %else G = sqrtm(C); | ||
56 | %end | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/hotel.mat b/SD-VBS/common/toolbox/toolbox_basic/fact/hotel.mat new file mode 100755 index 0000000..61ea6c8 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/hotel.mat | |||
Binary files differ | |||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/show_3dpoints.m b/SD-VBS/common/toolbox/toolbox_basic/fact/show_3dpoints.m new file mode 100755 index 0000000..b6edfd5 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/show_3dpoints.m | |||
@@ -0,0 +1,22 @@ | |||
1 | function show_3dpoints(S) | ||
2 | |||
3 | |||
4 | for j=1:size(S,2), | ||
5 | x = S(1,j); | ||
6 | y = S(2,j); | ||
7 | z = S(3,j); | ||
8 | plot3(x,y,z,'*'); | ||
9 | hold on; | ||
10 | plot3([x,0],[y,0],[z,0],'r'); | ||
11 | % plot3([x,x],[y,y],[z,0],'r'); | ||
12 | % plot3([x,0],[y,y],[z,z],'r'); plot3([x,x],[y,0],[z,z],'r'); | ||
13 | text(x,y,z,int2str(j)) | ||
14 | % plot3(x,y,0,'co'); | ||
15 | end | ||
16 | |||
17 | grid on | ||
18 | xlabel('x'); | ||
19 | ylabel('y'); | ||
20 | zlabel('z'); | ||
21 | |||
22 | hold off \ No newline at end of file | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/show_S.m b/SD-VBS/common/toolbox/toolbox_basic/fact/show_S.m new file mode 100755 index 0000000..5828696 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/show_S.m | |||
@@ -0,0 +1,17 @@ | |||
1 | function show_S(S,fig) | ||
2 | |||
3 | if (nargin == 1), | ||
4 | figure(1); | ||
5 | else | ||
6 | figure(fig); | ||
7 | end | ||
8 | |||
9 | num_points = size(S,2); | ||
10 | |||
11 | subplot(1,2,1); plot(S(1,:),S(3,:),'cx'); axis('equal');axis('square');hold on | ||
12 | subplot(1,2,2); plot(S(2,:),S(3,:),'cx'); axis('equal');axis('square');hold on | ||
13 | |||
14 | for j=1:num_points, | ||
15 | subplot(1,2,1);text(S(1,j),S(3,j),int2str(j));hold off | ||
16 | subplot(1,2,2);text(S(2,j),S(3,j),int2str(j));hold off | ||
17 | end | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/show_t.m b/SD-VBS/common/toolbox/toolbox_basic/fact/show_t.m new file mode 100755 index 0000000..b475c76 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/show_t.m | |||
@@ -0,0 +1,10 @@ | |||
1 | function show_t(t) | ||
2 | |||
3 | frames = 0.5*length(t); | ||
4 | |||
5 | ts = reshape(t,frames,2); | ||
6 | |||
7 | plot(ts(:,1),ts(:,2)); | ||
8 | hold on | ||
9 | plot(ts(:,1),ts(:,2),'rx'); | ||
10 | hold off; | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/show_t3.m b/SD-VBS/common/toolbox/toolbox_basic/fact/show_t3.m new file mode 100755 index 0000000..2766061 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/show_t3.m | |||
@@ -0,0 +1,10 @@ | |||
1 | function show_t(t) | ||
2 | |||
3 | frames = length(t)/3; | ||
4 | |||
5 | ts = reshape(t,frames,3); | ||
6 | |||
7 | plot3(ts(:,1),ts(:,2),ts(:,3)); | ||
8 | hold on | ||
9 | plot3(ts(:,1),ts(:,2),ts(:,3),'rx'); | ||
10 | hold off; | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/zt.m b/SD-VBS/common/toolbox/toolbox_basic/fact/zt.m new file mode 100755 index 0000000..3f88d21 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/zt.m | |||
@@ -0,0 +1,6 @@ | |||
1 | % the z' operator described in the paper (returns a row vector) | ||
2 | |||
3 | function v = zt(a, b) | ||
4 | |||
5 | v = [ a(1)*b(1), a(1)*b(2)+a(2)*b(1), a(1)*b(3)+a(3)*b(1), ... | ||
6 | a(2)*b(2), a(2)*b(3)+a(3)*b(2), a(3)*b(3) ]; | ||