Line | |
---|
1 | % By Philip Torr 2002
|
---|
2 | % copyright Microsoft Corp.
|
---|
3 | %%%%%%this is going to be my first try at some symbolic stuff
|
---|
4 |
|
---|
5 | %%%the purpose of this file is to set up an essential matrix that you can later do symbolic manipulation of,.
|
---|
6 |
|
---|
7 |
|
---|
8 | syms tx ty tz;
|
---|
9 |
|
---|
10 | Tx = [0 -tz ty; tz 0 -tx; -ty tx 0];
|
---|
11 |
|
---|
12 | %rodriggues formula a rotation angle l m n axis
|
---|
13 |
|
---|
14 | syms lx ly lz a
|
---|
15 |
|
---|
16 | Id = [1 0 0; 0 1 0; 0 0 1]
|
---|
17 | Ax = [0 -lz ly; lz 0 -lx; -ly lx 0];
|
---|
18 | rot_axT = [ lx ly lz]
|
---|
19 | rot_ax = [ lx; ly; lz]
|
---|
20 |
|
---|
21 | R = (cos(a) * Id + sin(a) * Ax + (1 - cos(a)) * rot_ax * rot_axT)
|
---|
22 |
|
---|
23 |
|
---|
24 | E = Tx * R
|
---|
25 |
|
---|
26 | syms foc
|
---|
27 |
|
---|
28 | Ca = [1 0 0; 0 1 0; 0 0 foc]
|
---|
29 |
|
---|
30 | G = Ca * E * Ca
|
---|
31 | %det(E)
|
---|
32 | %0.5 * (trace( E * E'))^2 - trace((E * E')^2)
|
---|
33 |
|
---|
34 | syms x1 x2 y1 y2
|
---|
35 |
|
---|
36 |
|
---|
37 |
|
---|
38 | r = [x2 y2 1] * G * [x1; y1; 1] |
---|
Note: See
TracBrowser
for help on using the repository browser.