aboutsummaryrefslogtreecommitdiff
path: root/cartesian2spherical.pd
blob: 0dea1ef09a9338f0d62e7a4fee035da271be3b95 (plain)
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
#N canvas 1 53 597 422 10;
#X obj 107 89 purepd/float_argument \$1;
#X obj 267 89 purepd/float_argument \$2;
#X obj 427 89 purepd/float_argument \$3;
#X obj 300 44 loadbang;
#X obj 107 169 pack float float float;
#X obj 107 190 trigger anything anything anything;
#X obj 47 12 inlet x;
#X obj 267 12 inlet y;
#X obj 427 12 inlet z;
#X obj 397 355 outlet theta;
#X obj 207 355 outlet phi;
#X text 275 167 $f1 = x;
#X text 334 168 $f2 = y;
#X text 392 169 $f3 = z;
#X obj 397 278 expr atan($f2/$f1);
#X obj 207 254 expr atan(sqrt(($f1*$f1) + ($f2*$f2))/$f3);
#X obj 14 228 expr sqrt(($f1*$f1) + ($f2*$f2) + ($f3*$f3));
#X obj 397 329 mapping/radians2mapping;
#X obj 207 329 mapping/radians2mapping;
#X obj 14 355 outlet;
#X text 142 375 output range on all outlets: 0 to 1;
#X obj 171 148 - 1;
#X obj 171 128 * 2;
#X text 265 139 convert range to -1 to 1;
#X obj 236 148 - 1;
#X obj 236 128 * 2;
#X obj 107 148 - 1;
#X obj 107 128 * 2;
#X obj 14 324 / 1.73205;
#X text 390 397 released under the GNU GPL;
#X text 43 397 (C) Copyright 2008 Hans-Christoph Steiner <hans@at.or.at>
;
#X connect 0 0 27 0;
#X connect 1 0 22 0;
#X connect 2 0 25 0;
#X connect 3 0 1 0;
#X connect 3 0 2 0;
#X connect 3 0 0 0;
#X connect 4 0 5 0;
#X connect 5 0 16 0;
#X connect 5 1 15 0;
#X connect 5 2 14 0;
#X connect 6 0 27 0;
#X connect 7 0 22 0;
#X connect 8 0 25 0;
#X connect 14 0 17 0;
#X connect 15 0 18 0;
#X connect 16 0 28 0;
#X connect 17 0 9 0;
#X connect 18 0 10 0;
#X connect 21 0 4 1;
#X connect 22 0 21 0;
#X connect 24 0 4 2;
#X connect 25 0 24 0;
#X connect 26 0 4 0;
#X connect 27 0 26 0;
#X connect 28 0 19 0;