Skip to content

Commit f7b0d45

Browse files
committed
Trigonometry changes
1 parent 43288f7 commit f7b0d45

File tree

9 files changed

+27377
-29
lines changed

9 files changed

+27377
-29
lines changed

package-lock.json

Lines changed: 25848 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/js/reference.js

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

src/data/examples/build_examples/package-lock.json

Lines changed: 1169 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/data/examples/build_examples/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
"dependencies": {
1010
"async": "^0.9.0",
1111
"csv": "^0.0.10",
12-
"ejs": "^2.5.7",
12+
"ejs": "^3.1.8",
1313
"grunt": "^1.5.3",
1414
"rimraf": "^2.2.8"
15-
},
16-
"devDependencies": {}
15+
}
1716
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
}

0 commit comments

Comments
 (0)