-
Notifications
You must be signed in to change notification settings - Fork 0
/
Orthonormal_Frame_TEST.m
58 lines (53 loc) · 966 Bytes
/
Orthonormal_Frame_TEST.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% % test q7
% % test 1
% Expected
e1 = [1,0,0];
e2 = [0,1,0];
e3 = [0,0,1];
Oe = [0.33,0.33,0];
% Output
[ v1, v2, v3, Ov ] = Orthonormal_Frame( [0,0,0],[1,0,0],[0,1,0] );
disp('Expected: in order e1,e2,e3,Oe');
disp(e1);
disp(e2);
disp(e3);
disp(Oe);
disp('Calculated: in order v1,v2,v3,Ov');
disp(v1);
disp(v2);
disp(v3);
disp(Ov);
% % test 2: collinear
% Expected
e1 = [1,0,0];
Oe = [0.66,0,0];
% Output
[ v1, v2, v3, Ov ] = Orthonormal_Frame( [0,0,0],[1,0,0],[1,0,0] );
disp('Expected: in order e1,e2,e3,Oe');
disp(e1);
disp(e2);
disp(e3);
disp(Oe);
disp('Calculated: in order v1,v2,v3,Ov');
disp(v1);
disp(v2);
disp(v3);
disp(Ov);
% % test 3
% Expected
e1 = [0,0,1];
e2 = [0,-1,0];
e3 = [1,0,0];
Oe = [1,0.66,0.66];
% Output
[ v1, v2, v3, Ov ] = Orthonormal_Frame( [1,1,0],[1,1,1],[1,0,1] );
disp('Expected: in order e1,e2,e3,Oe');
disp(e1);
disp(e2);
disp(e3);
disp(Oe);
disp('Calculated: in order v1,v2,v3,Ov');
disp(v1);
disp(v2);
disp(v3);
disp(Ov);