aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranz Zotter <fzotter@users.sourceforge.net>2009-11-28 12:41:04 +0000
committerFranz Zotter <fzotter@users.sourceforge.net>2009-11-28 12:41:04 +0000
commit68729718fce729bfdca438af1ac26971baf64218 (patch)
tree4f0827421ac173d24a192e5b00b0b1348968de03
parent3085f960c5abed8642d28b2a8acc036708c229b8 (diff)
added abstractions for 3x3 and 2x2 rotation matrices and spherical to cartesian coordinates conversion.
[mtx_sph2cart][mtx_cart2sph] [mtx_rot][mtx_rotx][mtx_roty][mtx_rotz][mtx_rotxyz][mtx_rotzyz] svn path=/trunk/externals/iem/iemmatrix/; revision=12812
-rw-r--r--abs/mtx_cart2sph-help.pd20
-rw-r--r--abs/mtx_cart2sph.pd55
-rw-r--r--abs/mtx_rot-help.pd28
-rw-r--r--abs/mtx_rot.pd26
-rw-r--r--abs/mtx_rotx-help.pd29
-rw-r--r--abs/mtx_rotx.pd20
-rw-r--r--abs/mtx_rotxyz.pd25
-rw-r--r--abs/mtx_roty-help.pd29
-rw-r--r--abs/mtx_roty.pd22
-rw-r--r--abs/mtx_rotz-help.pd29
-rw-r--r--abs/mtx_rotz.pd18
-rw-r--r--abs/mtx_rotzyz.pd25
-rw-r--r--abs/mtx_sph2cart-help.pd25
-rw-r--r--abs/mtx_sph2cart.pd44
14 files changed, 395 insertions, 0 deletions
diff --git a/abs/mtx_cart2sph-help.pd b/abs/mtx_cart2sph-help.pd
new file mode 100644
index 0000000..500ca5c
--- /dev/null
+++ b/abs/mtx_cart2sph-help.pd
@@ -0,0 +1,20 @@
+#N canvas 0 0 450 300 10;
+#X obj 69 114 mtx 3 1;
+#X text 126 70 2 ey;
+#X text 144 94 3 ez;
+#X text 264 202 Franz Zotter \, 2009;
+#X text 19 11 converting cartersian to spherical coordinates;
+#X msg 26 49 1 0 0;
+#X text 81 47 1 ex;
+#X obj 69 147 mtx_cart2sph;
+#X msg 69 71 0 2 0;
+#X msg 97 91 0 0 3;
+#X text 219 62 input matrices have the shape 3xL;
+#X text 221 76 and may contain L points;
+#X text 219 93 [ x \; y \; z ];
+#X obj 69 191 mtx_print rphitheta;
+#X connect 0 0 7 0;
+#X connect 5 0 0 0;
+#X connect 7 0 13 0;
+#X connect 8 0 0 0;
+#X connect 9 0 0 0;
diff --git a/abs/mtx_cart2sph.pd b/abs/mtx_cart2sph.pd
new file mode 100644
index 0000000..f206e42
--- /dev/null
+++ b/abs/mtx_cart2sph.pd
@@ -0,0 +1,55 @@
+#N canvas 612 222 562 551 10;
+#X obj 101 377 mtx_concat;
+#X obj 205 141 mtx_slice 1 1 1 end;
+#X obj 44 398 mtx_concat;
+#X text 229 451 Franz Zotter \, 2009;
+#X text 231 428 [iemmatrix];
+#X obj 44 17 inlet \; [x \; y \; z];
+#X obj 44 467 outlet \; [r \; phi \; theta];
+#X obj 44 280 mtx_+;
+#X obj 44 261 mtx_.^ 2;
+#X obj 178 261 mtx_+;
+#X obj 178 212 mtx_.^ 2;
+#X obj 205 239 mtx_.^ 2;
+#X text 188 306 rxy;
+#X obj 178 350 mtx_atan2;
+#X obj 151 173 mtx_slice 2 1 2 end;
+#X obj 333 140 mtx_slice 3 1 3 end;
+#X obj 44 239 mtx;
+#X obj 44 93 t b a a a;
+#X obj 44 299 mtx_.^ 0.5;
+#X obj 151 192 t a a;
+#X text 229 309 z;
+#X obj 101 350 mtx_atan2;
+#X obj 192 388 mtx_size;
+#X floatatom 192 409 5 0 0 0 - - -;
+#X floatatom 241 410 5 0 0 0 - - -;
+#X obj 178 328 mtx_.^ 0.5;
+#X connect 0 0 2 1;
+#X connect 1 0 11 0;
+#X connect 1 0 21 1;
+#X connect 2 0 6 0;
+#X connect 5 0 17 0;
+#X connect 7 0 18 0;
+#X connect 8 0 7 0;
+#X connect 9 0 7 1;
+#X connect 9 0 25 0;
+#X connect 10 0 9 0;
+#X connect 11 0 9 1;
+#X connect 13 0 0 1;
+#X connect 13 0 22 0;
+#X connect 14 0 19 0;
+#X connect 15 0 16 1;
+#X connect 15 0 13 1;
+#X connect 16 0 8 0;
+#X connect 17 0 16 0;
+#X connect 17 1 14 0;
+#X connect 17 2 1 0;
+#X connect 17 3 15 0;
+#X connect 18 0 2 0;
+#X connect 19 0 21 0;
+#X connect 19 1 10 0;
+#X connect 21 0 0 0;
+#X connect 22 0 23 0;
+#X connect 22 1 24 0;
+#X connect 25 0 13 0;
diff --git a/abs/mtx_rot-help.pd b/abs/mtx_rot-help.pd
new file mode 100644
index 0000000..bcdb516
--- /dev/null
+++ b/abs/mtx_rot-help.pd
@@ -0,0 +1,28 @@
+#N canvas 541 188 450 300 10;
+#X obj 72 78 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 -262144
+-1 -1 0 1;
+#X floatatom 69 98 5 0 0 0 - - -;
+#X obj 69 115 *;
+#X obj 225 105 atan;
+#X msg 225 85 1;
+#X obj 225 65 loadbang;
+#X obj 225 124 / 45;
+#X obj 69 136 mtx_rot;
+#X obj 69 173 mtx_print R;
+#X text 58 23 2 dimensional cartesian rotation matrix;
+#X msg 33 51 0;
+#X msg 64 51 90;
+#X msg 94 51 180;
+#X msg 126 51 270;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 7 0;
+#X connect 3 0 6 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 6 0 2 1;
+#X connect 7 0 8 0;
+#X connect 10 0 1 0;
+#X connect 11 0 1 0;
+#X connect 12 0 1 0;
+#X connect 13 0 1 0;
diff --git a/abs/mtx_rot.pd b/abs/mtx_rot.pd
new file mode 100644
index 0000000..c1622dc
--- /dev/null
+++ b/abs/mtx_rot.pd
@@ -0,0 +1,26 @@
+#N canvas 570 39 450 393 10;
+#X obj 94 26 inlet;
+#X obj 94 237 outlet;
+#X obj 151 97 sin;
+#X obj 94 95 cos;
+#X obj 151 115 t f f;
+#X obj 151 135 * -1;
+#X obj 94 173 mtx_diag;
+#X obj 94 207 mtx_+;
+#X obj 151 154 pack f f;
+#X obj 94 54 t f f;
+#X obj 151 175 mtx_diegg;
+#X msg 94 153 \$1 \$1;
+#X connect 0 0 9 0;
+#X connect 2 0 4 0;
+#X connect 3 0 11 0;
+#X connect 4 0 5 0;
+#X connect 4 1 8 1;
+#X connect 5 0 8 0;
+#X connect 6 0 7 0;
+#X connect 7 0 1 0;
+#X connect 8 0 10 0;
+#X connect 9 0 3 0;
+#X connect 9 1 2 0;
+#X connect 10 0 7 1;
+#X connect 11 0 6 0;
diff --git a/abs/mtx_rotx-help.pd b/abs/mtx_rotx-help.pd
new file mode 100644
index 0000000..ba8d443
--- /dev/null
+++ b/abs/mtx_rotx-help.pd
@@ -0,0 +1,29 @@
+#N canvas 0 0 450 300 10;
+#X obj 72 108 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 -262144
+-1 -1 0 1;
+#X floatatom 69 128 5 0 0 0 - - -;
+#X obj 69 145 *;
+#X obj 225 135 atan;
+#X msg 225 115 1;
+#X obj 225 95 loadbang;
+#X obj 225 154 / 45;
+#X obj 69 203 mtx_print Rx;
+#X msg 12 66 0;
+#X msg 43 66 90;
+#X msg 73 66 180;
+#X msg 105 66 270;
+#X obj 69 165 mtx_rotx;
+#X text 58 23 3 dimensional cartesian rotation matrix \, rotating around
+x-axis;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 12 0;
+#X connect 3 0 6 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 6 0 2 1;
+#X connect 8 0 1 0;
+#X connect 9 0 1 0;
+#X connect 10 0 1 0;
+#X connect 11 0 1 0;
+#X connect 12 0 7 0;
diff --git a/abs/mtx_rotx.pd b/abs/mtx_rotx.pd
new file mode 100644
index 0000000..74c225e
--- /dev/null
+++ b/abs/mtx_rotx.pd
@@ -0,0 +1,20 @@
+#N canvas 570 39 450 393 10;
+#X obj 94 26 inlet;
+#X obj 94 187 outlet;
+#X obj 94 48 mtx_rot;
+#X obj 194 25 loadbang;
+#X obj 194 65 mtx_diag;
+#X obj 94 70 mtx_resize 3 3;
+#X obj 94 108 mtx_+;
+#X obj 94 133 mtx_roll 1;
+#X obj 94 154 mtx_scroll 1;
+#X msg 194 46 0 0 1;
+#X connect 0 0 2 0;
+#X connect 2 0 5 0;
+#X connect 3 0 9 0;
+#X connect 4 0 6 1;
+#X connect 5 0 6 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 8 0 1 0;
+#X connect 9 0 4 0;
diff --git a/abs/mtx_rotxyz.pd b/abs/mtx_rotxyz.pd
new file mode 100644
index 0000000..aeb2103
--- /dev/null
+++ b/abs/mtx_rotxyz.pd
@@ -0,0 +1,25 @@
+#N canvas 98 59 450 317 10;
+#X obj 244 21 inlet beta_y;
+#X obj 327 21 inlet gamma_z;
+#X obj 72 278 outlet;
+#X obj 72 104 pack f f f;
+#X obj 107 231 mtx_*;
+#X obj 72 252 mtx_*;
+#X obj 72 125 unpack f f f;
+#X text 211 179 3x3 rotation matrix;
+#X obj 106 187 mtx_roty;
+#X obj 141 159 mtx_rotz;
+#X obj 72 208 mtx_rotx;
+#X obj 72 21 inlet alpha_z \; [alpha_x \, beta_y \, gamma_y(;
+#X connect 0 0 3 1;
+#X connect 1 0 3 2;
+#X connect 3 0 6 0;
+#X connect 4 0 5 1;
+#X connect 5 0 2 0;
+#X connect 6 0 10 0;
+#X connect 6 1 8 0;
+#X connect 6 2 9 0;
+#X connect 8 0 4 0;
+#X connect 9 0 4 1;
+#X connect 10 0 5 0;
+#X connect 11 0 3 0;
diff --git a/abs/mtx_roty-help.pd b/abs/mtx_roty-help.pd
new file mode 100644
index 0000000..d81f4eb
--- /dev/null
+++ b/abs/mtx_roty-help.pd
@@ -0,0 +1,29 @@
+#N canvas 0 0 450 300 10;
+#X obj 72 108 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 -262144
+-1 -1 0 1;
+#X floatatom 69 128 5 0 0 0 - - -;
+#X obj 69 145 *;
+#X obj 225 135 atan;
+#X msg 225 115 1;
+#X obj 225 95 loadbang;
+#X obj 225 154 / 45;
+#X msg 12 66 0;
+#X msg 43 66 90;
+#X msg 73 66 180;
+#X msg 105 66 270;
+#X text 58 23 3 dimensional cartesian rotation matrix \, rotating around
+y-axis;
+#X obj 69 165 mtx_roty;
+#X obj 69 203 mtx_print Ry;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 12 0;
+#X connect 3 0 6 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 6 0 2 1;
+#X connect 7 0 1 0;
+#X connect 8 0 1 0;
+#X connect 9 0 1 0;
+#X connect 10 0 1 0;
+#X connect 12 0 13 0;
diff --git a/abs/mtx_roty.pd b/abs/mtx_roty.pd
new file mode 100644
index 0000000..e7d11c5
--- /dev/null
+++ b/abs/mtx_roty.pd
@@ -0,0 +1,22 @@
+#N canvas 570 39 450 393 10;
+#X obj 94 26 inlet;
+#X obj 94 187 outlet;
+#X obj 94 64 mtx_rot;
+#X obj 194 25 loadbang;
+#X obj 194 65 mtx_diag;
+#X obj 94 86 mtx_resize 3 3;
+#X obj 94 108 mtx_+;
+#X msg 194 46 0 0 1;
+#X obj 94 133 mtx_roll -1;
+#X obj 94 154 mtx_scroll -1;
+#X obj 94 45 * -1;
+#X connect 0 0 10 0;
+#X connect 2 0 5 0;
+#X connect 3 0 7 0;
+#X connect 4 0 6 1;
+#X connect 5 0 6 0;
+#X connect 6 0 8 0;
+#X connect 7 0 4 0;
+#X connect 8 0 9 0;
+#X connect 9 0 1 0;
+#X connect 10 0 2 0;
diff --git a/abs/mtx_rotz-help.pd b/abs/mtx_rotz-help.pd
new file mode 100644
index 0000000..fb4b2f0
--- /dev/null
+++ b/abs/mtx_rotz-help.pd
@@ -0,0 +1,29 @@
+#N canvas 0 0 450 300 10;
+#X obj 72 108 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 -262144
+-1 -1 0 1;
+#X floatatom 69 128 5 0 0 0 - - -;
+#X obj 69 145 *;
+#X obj 225 135 atan;
+#X msg 225 115 1;
+#X obj 225 95 loadbang;
+#X obj 225 154 / 45;
+#X msg 12 66 0;
+#X msg 43 66 90;
+#X msg 73 66 180;
+#X msg 105 66 270;
+#X text 58 23 3 dimensional cartesian rotation matrix \, rotating around
+z-axis;
+#X obj 69 203 mtx_print Rz;
+#X obj 69 165 mtx_rotz;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 13 0;
+#X connect 3 0 6 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 6 0 2 1;
+#X connect 7 0 1 0;
+#X connect 8 0 1 0;
+#X connect 9 0 1 0;
+#X connect 10 0 1 0;
+#X connect 13 0 12 0;
diff --git a/abs/mtx_rotz.pd b/abs/mtx_rotz.pd
new file mode 100644
index 0000000..06d002d
--- /dev/null
+++ b/abs/mtx_rotz.pd
@@ -0,0 +1,18 @@
+#N canvas 570 39 450 393 10;
+#X obj 94 26 inlet;
+#X obj 94 187 outlet;
+#X obj 94 64 mtx_rot;
+#X obj 194 25 loadbang;
+#X obj 194 65 mtx_diag;
+#X obj 94 86 mtx_resize 3 3;
+#X obj 94 108 mtx_+;
+#X msg 194 46 0 0 1;
+#X obj 94 45 * -1;
+#X connect 0 0 8 0;
+#X connect 2 0 5 0;
+#X connect 3 0 7 0;
+#X connect 4 0 6 1;
+#X connect 5 0 6 0;
+#X connect 6 0 1 0;
+#X connect 7 0 4 0;
+#X connect 8 0 2 0;
diff --git a/abs/mtx_rotzyz.pd b/abs/mtx_rotzyz.pd
new file mode 100644
index 0000000..08ae6c1
--- /dev/null
+++ b/abs/mtx_rotzyz.pd
@@ -0,0 +1,25 @@
+#N canvas 98 59 450 317 10;
+#X obj 244 21 inlet beta_y;
+#X obj 327 21 inlet gamma_z;
+#X obj 72 278 outlet;
+#X obj 72 104 pack f f f;
+#X obj 72 21 inlet alpha_z \; [alpha_z \, beta_y \, gamma_y(;
+#X obj 107 231 mtx_*;
+#X obj 72 252 mtx_*;
+#X obj 72 125 unpack f f f;
+#X text 211 179 3x3 rotation matrix;
+#X obj 106 187 mtx_roty;
+#X obj 141 159 mtx_rotz;
+#X obj 72 208 mtx_rotz;
+#X connect 0 0 3 1;
+#X connect 1 0 3 2;
+#X connect 3 0 7 0;
+#X connect 4 0 3 0;
+#X connect 5 0 6 1;
+#X connect 6 0 2 0;
+#X connect 7 0 11 0;
+#X connect 7 1 9 0;
+#X connect 7 2 10 0;
+#X connect 9 0 5 0;
+#X connect 10 0 5 1;
+#X connect 11 0 6 0;
diff --git a/abs/mtx_sph2cart-help.pd b/abs/mtx_sph2cart-help.pd
new file mode 100644
index 0000000..3128d81
--- /dev/null
+++ b/abs/mtx_sph2cart-help.pd
@@ -0,0 +1,25 @@
+#N canvas 537 0 450 300 10;
+#X obj 69 114 mtx 3 1;
+#X text 169 70 2 ey;
+#X msg 26 49 1 0 1.5708;
+#X obj 69 147 mtx_sph2cart;
+#X msg 69 71 2 1.5708 1.5708;
+#X msg 97 91 3 0 0;
+#X text 144 94 3 ez;
+#X obj 69 191 mtx_print xyz;
+#X text 19 11 converting spherical to carteisan coordinates;
+#X text 264 202 Franz Zotter \, 2009;
+#X text 99 49 1 ex;
+#X text 219 62 input matrices have the shape 3xL;
+#X text 221 76 and may contain L points;
+#X text 219 93 [ r \; phi \; theta ];
+#X text 215 143 r... radius;
+#X text 215 156 phi... azimuth angle;
+#X text 215 169 theta.. zenith angle;
+#X text 239 243 see also;
+#X obj 298 243 mtx_cart2sph;
+#X connect 0 0 3 0;
+#X connect 2 0 0 0;
+#X connect 3 0 7 0;
+#X connect 4 0 0 0;
+#X connect 5 0 0 0;
diff --git a/abs/mtx_sph2cart.pd b/abs/mtx_sph2cart.pd
new file mode 100644
index 0000000..f83033a
--- /dev/null
+++ b/abs/mtx_sph2cart.pd
@@ -0,0 +1,44 @@
+#N canvas 683 47 450 551 10;
+#X obj 44 17 inlet \; [r \; phi \; theta];
+#X obj 44 467 outlet \; [x \; y \; z];
+#X obj 44 279 t a a;
+#X obj 101 377 mtx_concat;
+#X obj 44 378 mtx_.*;
+#X obj 296 139 mtx_slice 1 1 1 end;
+#X obj 196 211 mtx_cos;
+#X obj 169 253 mtx_sin;
+#X obj 169 183 t a a;
+#X obj 71 326 mtx_.*;
+#X obj 169 272 mtx_.*;
+#X obj 196 230 mtx_.*;
+#X obj 44 398 mtx_concat;
+#X obj 44 93 t a a a;
+#X text 229 451 Franz Zotter \, 2009;
+#X text 231 428 [iemmatrix];
+#X obj 44 255 mtx_slice 2 1 2 end;
+#X obj 169 159 mtx_slice 3 1 3 end;
+#X obj 44 359 mtx_cos;
+#X obj 71 307 mtx_sin;
+#X connect 0 0 13 0;
+#X connect 2 0 18 0;
+#X connect 2 1 19 0;
+#X connect 3 0 12 1;
+#X connect 4 0 12 0;
+#X connect 5 0 10 1;
+#X connect 5 0 11 1;
+#X connect 6 0 11 0;
+#X connect 7 0 10 0;
+#X connect 8 0 7 0;
+#X connect 8 1 6 0;
+#X connect 9 0 3 0;
+#X connect 10 0 9 1;
+#X connect 10 0 4 1;
+#X connect 11 0 3 1;
+#X connect 12 0 1 0;
+#X connect 13 0 16 0;
+#X connect 13 1 17 0;
+#X connect 13 2 5 0;
+#X connect 16 0 2 0;
+#X connect 17 0 8 0;
+#X connect 18 0 4 0;
+#X connect 19 0 9 0;