File tree Expand file tree Collapse file tree 9 files changed +27377
-29
lines changed Expand file tree Collapse file tree 9 files changed +27377
-29
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 9
9
"dependencies" : {
10
10
"async" : " ^0.9.0" ,
11
11
"csv" : " ^0.0.10" ,
12
- "ejs" : " ^2.5.7 " ,
12
+ "ejs" : " ^3.1.8 " ,
13
13
"grunt" : " ^1.5.3" ,
14
14
"rimraf" : " ^2.2.8"
15
- },
16
- "devDependencies" : {}
15
+ }
17
16
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @name Trigonometry and Particles
3
+ * @arialabel multiple white dot moving in pattern following trigonometry function
4
+ * @description Creative particle movement using cos(), sin() and tan(). You can sort
5
+ * through the different functions.
6
+ */
7
+ let f = 0 ;
8
+ let value = 0 ;
9
+ let clicked = 0 ;
10
+ let x = 0 ;
11
+ let y = 0 ;
12
+
13
+ function Super_Tornado ( ) {
14
+ ratio = frameCount * 0.01 ;
15
+ points = [ ] ;
16
+ fill ( 255 ) ;
17
+ for ( let i = 0 ; i <= 360 ; i += 0.1 ) {
18
+ let theta = radians ( i * ratio ) ;
19
+ if ( value == 0 ) {
20
+ x = cos ( theta ) * i ;
21
+ y = sin ( theta ) * i ;
22
+ }
23
+ if ( value == 1 ) {
24
+ x = cos ( 1 / theta ) * i * tan ( i ) ;
25
+ y = sin ( 1 / theta ) * i * tan ( i ) ;
26
+ }
27
+ if ( value == 2 ) {
28
+ x = cos ( theta ) * log ( i ) * tan ( i ) ;
29
+ y = sin ( 1 / theta ) * log ( i ) * tan ( i ) ;
30
+ }
31
+ if ( value == 3 ) {
32
+ x = cos ( theta ) * i * tan ( i ) ;
33
+ y = sin ( log ( theta ) ) * i / tan ( i ) ;
34
+ }
35
+ if ( value == 4 ) {
36
+ x = cos ( theta ) * i / 3 * sin ( theta ) * tan ( f + 1 ) ;
37
+ y = sin ( 1 / theta ) * i / 3 * log ( i ) * tan ( i ) ;
38
+ }
39
+
40
+ ellipse ( x , y , 3 , 3 ) ;
41
+
42
+ points . push ( {
43
+ 'x' : x ,
44
+ 'y' : y
45
+ } )
46
+ }
47
+ }
48
+
49
+ function setup ( ) {
50
+ createCanvas ( 400 , 400 ) ;
51
+ noStroke ( ) ;
52
+ }
53
+
54
+ function draw ( ) {
55
+ background ( 30 ) ;
56
+ translate ( width / 2 , height / 2 ) ;
57
+ ratio = frameCount * 0.01 ;
58
+ points = [ ] ;
59
+ Super_Tornado ( ) ;
60
+ }
61
+
62
+ function mouseClicked ( ) {
63
+ if ( clicked < 5 ) {
64
+ clicked ++ ;
65
+ value ++ ;
66
+ } else {
67
+ clicked = 0 ;
68
+ value = 0 ;
69
+ }
70
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @name Trigonometry and Particles
3
+ * @arialabel multiple white dot moving in pattern following trigonometry function
4
+ * @description Creative particle movement using cos(), sin() and tan(). You can sort
5
+ * through the different functions.
6
+ */
7
+ let f = 0 ;
8
+ let value = 0 ;
9
+ let clicked = 0 ;
10
+ let x = 0 ;
11
+ let y = 0 ;
12
+
13
+ function Super_Tornado ( ) {
14
+ ratio = frameCount * 0.01 ;
15
+ points = [ ] ;
16
+ fill ( 255 ) ;
17
+ for ( let i = 0 ; i <= 360 ; i += 0.1 ) {
18
+ let theta = radians ( i * ratio ) ;
19
+ if ( value == 0 ) {
20
+ x = cos ( theta ) * i ;
21
+ y = sin ( theta ) * i ;
22
+ }
23
+ if ( value == 1 ) {
24
+ x = cos ( 1 / theta ) * i * tan ( i ) ;
25
+ y = sin ( 1 / theta ) * i * tan ( i ) ;
26
+ }
27
+ if ( value == 2 ) {
28
+ x = cos ( theta ) * log ( i ) * tan ( i ) ;
29
+ y = sin ( 1 / theta ) * log ( i ) * tan ( i ) ;
30
+ }
31
+ if ( value == 3 ) {
32
+ x = cos ( theta ) * i * tan ( i ) ;
33
+ y = sin ( log ( theta ) ) * i / tan ( i ) ;
34
+ }
35
+ if ( value == 4 ) {
36
+ x = cos ( theta ) * i / 3 * sin ( theta ) * tan ( f + 1 ) ;
37
+ y = sin ( 1 / theta ) * i / 3 * log ( i ) * tan ( i ) ;
38
+ }
39
+
40
+ ellipse ( x , y , 3 , 3 ) ;
41
+
42
+ points . push ( {
43
+ 'x' : x ,
44
+ 'y' : y
45
+ } )
46
+ }
47
+ }
48
+
49
+ function setup ( ) {
50
+ createCanvas ( 400 , 400 ) ;
51
+ noStroke ( ) ;
52
+ }
53
+
54
+ function draw ( ) {
55
+ background ( 30 ) ;
56
+ translate ( width / 2 , height / 2 ) ;
57
+ ratio = frameCount * 0.01 ;
58
+ points = [ ] ;
59
+ Super_Tornado ( ) ;
60
+ }
61
+
62
+ function mouseClicked ( ) {
63
+ if ( clicked < 5 ) {
64
+ clicked ++ ;
65
+ value ++ ;
66
+ } else {
67
+ clicked = 0 ;
68
+ value = 0 ;
69
+ }
70
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @name Trigonometry and Particles
3
+ * @arialabel multiple white dot moving in pattern following trigonometry function
4
+ * @description Creative particle movement using cos(), sin() and tan(). You can sort
5
+ * through the different functions.
6
+ */
7
+ let f = 0 ;
8
+ let value = 0 ;
9
+ let clicked = 0 ;
10
+ let x = 0 ;
11
+ let y = 0 ;
12
+
13
+ function Super_Tornado ( ) {
14
+ ratio = frameCount * 0.01 ;
15
+ points = [ ] ;
16
+ fill ( 255 ) ;
17
+ for ( let i = 0 ; i <= 360 ; i += 0.1 ) {
18
+ let theta = radians ( i * ratio ) ;
19
+ if ( value == 0 ) {
20
+ x = cos ( theta ) * i ;
21
+ y = sin ( theta ) * i ;
22
+ }
23
+ if ( value == 1 ) {
24
+ x = cos ( 1 / theta ) * i * tan ( i ) ;
25
+ y = sin ( 1 / theta ) * i * tan ( i ) ;
26
+ }
27
+ if ( value == 2 ) {
28
+ x = cos ( theta ) * log ( i ) * tan ( i ) ;
29
+ y = sin ( 1 / theta ) * log ( i ) * tan ( i ) ;
30
+ }
31
+ if ( value == 3 ) {
32
+ x = cos ( theta ) * i * tan ( i ) ;
33
+ y = sin ( log ( theta ) ) * i / tan ( i ) ;
34
+ }
35
+ if ( value == 4 ) {
36
+ x = cos ( theta ) * i / 3 * sin ( theta ) * tan ( f + 1 ) ;
37
+ y = sin ( 1 / theta ) * i / 3 * log ( i ) * tan ( i ) ;
38
+ }
39
+
40
+ ellipse ( x , y , 3 , 3 ) ;
41
+
42
+ points . push ( {
43
+ 'x' : x ,
44
+ 'y' : y
45
+ } )
46
+ }
47
+ }
48
+
49
+ function setup ( ) {
50
+ createCanvas ( 400 , 400 ) ;
51
+ noStroke ( ) ;
52
+ }
53
+
54
+ function draw ( ) {
55
+ background ( 30 ) ;
56
+ translate ( width / 2 , height / 2 ) ;
57
+ ratio = frameCount * 0.01 ;
58
+ points = [ ] ;
59
+ Super_Tornado ( ) ;
60
+ }
61
+
62
+ function mouseClicked ( ) {
63
+ if ( clicked < 5 ) {
64
+ clicked ++ ;
65
+ value ++ ;
66
+ } else {
67
+ clicked = 0 ;
68
+ value = 0 ;
69
+ }
70
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @name Trigonometry and Particles
3
+ * @arialabel multiple white dot moving in pattern following trigonometry function
4
+ * @description Creative particle movement using cos(), sin() and tan(). You can sort
5
+ * through the different functions.
6
+ */
7
+ let f = 0 ;
8
+ let value = 0 ;
9
+ let clicked = 0 ;
10
+ let x = 0 ;
11
+ let y = 0 ;
12
+
13
+ function Super_Tornado ( ) {
14
+ ratio = frameCount * 0.01 ;
15
+ points = [ ] ;
16
+ fill ( 255 ) ;
17
+ for ( let i = 0 ; i <= 360 ; i += 0.1 ) {
18
+ let theta = radians ( i * ratio ) ;
19
+ if ( value == 0 ) {
20
+ x = cos ( theta ) * i ;
21
+ y = sin ( theta ) * i ;
22
+ }
23
+ if ( value == 1 ) {
24
+ x = cos ( 1 / theta ) * i * tan ( i ) ;
25
+ y = sin ( 1 / theta ) * i * tan ( i ) ;
26
+ }
27
+ if ( value == 2 ) {
28
+ x = cos ( theta ) * log ( i ) * tan ( i ) ;
29
+ y = sin ( 1 / theta ) * log ( i ) * tan ( i ) ;
30
+ }
31
+ if ( value == 3 ) {
32
+ x = cos ( theta ) * i * tan ( i ) ;
33
+ y = sin ( log ( theta ) ) * i / tan ( i ) ;
34
+ }
35
+ if ( value == 4 ) {
36
+ x = cos ( theta ) * i / 3 * sin ( theta ) * tan ( f + 1 ) ;
37
+ y = sin ( 1 / theta ) * i / 3 * log ( i ) * tan ( i ) ;
38
+ }
39
+
40
+ ellipse ( x , y , 3 , 3 ) ;
41
+
42
+ points . push ( {
43
+ 'x' : x ,
44
+ 'y' : y
45
+ } )
46
+ }
47
+ }
48
+
49
+ function setup ( ) {
50
+ createCanvas ( 400 , 400 ) ;
51
+ noStroke ( ) ;
52
+ }
53
+
54
+ function draw ( ) {
55
+ background ( 30 ) ;
56
+ translate ( width / 2 , height / 2 ) ;
57
+ ratio = frameCount * 0.01 ;
58
+ points = [ ] ;
59
+ Super_Tornado ( ) ;
60
+ }
61
+
62
+ function mouseClicked ( ) {
63
+ if ( clicked < 5 ) {
64
+ clicked ++ ;
65
+ value ++ ;
66
+ } else {
67
+ clicked = 0 ;
68
+ value = 0 ;
69
+ }
70
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @name Trigonometry and Particles
3
+ * @arialabel multiple white dot moving in pattern following trigonometry function
4
+ * @description Creative particle movement using cos(), sin() and tan(). You can sort
5
+ * through the different functions.
6
+ */
7
+ let f = 0 ;
8
+ let value = 0 ;
9
+ let clicked = 0 ;
10
+ let x = 0 ;
11
+ let y = 0 ;
12
+
13
+ function Super_Tornado ( ) {
14
+ ratio = frameCount * 0.01 ;
15
+ points = [ ] ;
16
+ fill ( 255 ) ;
17
+ for ( let i = 0 ; i <= 360 ; i += 0.1 ) {
18
+ let theta = radians ( i * ratio ) ;
19
+ if ( value == 0 ) {
20
+ x = cos ( theta ) * i ;
21
+ y = sin ( theta ) * i ;
22
+ }
23
+ if ( value == 1 ) {
24
+ x = cos ( 1 / theta ) * i * tan ( i ) ;
25
+ y = sin ( 1 / theta ) * i * tan ( i ) ;
26
+ }
27
+ if ( value == 2 ) {
28
+ x = cos ( theta ) * log ( i ) * tan ( i ) ;
29
+ y = sin ( 1 / theta ) * log ( i ) * tan ( i ) ;
30
+ }
31
+ if ( value == 3 ) {
32
+ x = cos ( theta ) * i * tan ( i ) ;
33
+ y = sin ( log ( theta ) ) * i / tan ( i ) ;
34
+ }
35
+ if ( value == 4 ) {
36
+ x = cos ( theta ) * i / 3 * sin ( theta ) * tan ( f + 1 ) ;
37
+ y = sin ( 1 / theta ) * i / 3 * log ( i ) * tan ( i ) ;
38
+ }
39
+
40
+ ellipse ( x , y , 3 , 3 ) ;
41
+
42
+ points . push ( {
43
+ 'x' : x ,
44
+ 'y' : y
45
+ } )
46
+ }
47
+ }
48
+
49
+ function setup ( ) {
50
+ createCanvas ( 400 , 400 ) ;
51
+ noStroke ( ) ;
52
+ }
53
+
54
+ function draw ( ) {
55
+ background ( 30 ) ;
56
+ translate ( width / 2 , height / 2 ) ;
57
+ ratio = frameCount * 0.01 ;
58
+ points = [ ] ;
59
+ Super_Tornado ( ) ;
60
+ }
61
+
62
+ function mouseClicked ( ) {
63
+ if ( clicked < 5 ) {
64
+ clicked ++ ;
65
+ value ++ ;
66
+ } else {
67
+ clicked = 0 ;
68
+ value = 0 ;
69
+ }
70
+ }
You can’t perform that action at this time.
0 commit comments