summaryrefslogtreecommitdiff
path: root/basis_transformation.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2009-12-22 21:48:01 +0000
committerEugeniy Mikhailov <evgmik@gmail.com>2009-12-22 21:48:01 +0000
commit539cde27dee1cd9721a4684f815883b44464170c (patch)
tree5ca701e9fff2226e7cd948a58126c985fcdfab05 /basis_transformation.m
parent13234166dcaee5760c72af6658a76eb319bd2af6 (diff)
downloadmulti_mode_eit-539cde27dee1cd9721a4684f815883b44464170c.tar.gz
multi_mode_eit-539cde27dee1cd9721a4684f815883b44464170c.zip
added basis transformation file
Diffstat (limited to 'basis_transformation.m')
-rw-r--r--basis_transformation.m28
1 files changed, 28 insertions, 0 deletions
diff --git a/basis_transformation.m b/basis_transformation.m
new file mode 100644
index 0000000..01c3202
--- /dev/null
+++ b/basis_transformation.m
@@ -0,0 +1,28 @@
+1;
+
+% matrix of circular to linear transformation
+% [x, l, z]' = lin2circ * [r, l, z]'
+circ2lin= [ ...
+ [ 1/sqrt(2), 1/sqrt(2), 0]; ...
+ [-1i/sqrt(2), 1i/sqrt(2), 0]; ...
+ [ 0, 0, 1] ...
+ ];
+
+% matrix of linear to circular transformation
+% [r, l, z]' = lin2circ * [x, y, z]'
+lin2circ=inverse(circ2lin);
+
+% linear basis rotation
+% x axis untouched
+% z and y rotated by angle theta around 'x' axis
+% [x_new, y_new, z_new]' = oldlin2newlin * [x_old, y_old, z_old]'
+function coord_new = oldlin2newlin(coord_old, theta)
+ oldlin2newlin_m = [ ...
+ [ 1, 0, 0]; ...
+ [ 0, cos(theta), -sin(theta)]; ...
+ [ 0, sin(theta), cos(theta)]...
+ ];
+ coord_new = oldlin2newlin_m * coord_old;
+endfunction
+
+% vim: ts=2:sw=2:fdm=indent