Skip to content

Commit 53d8c12

Browse files
committed
Merge branch 'master' of https://github.com/processing/p5.js-website into sidebar_reponsive_mobile
2 parents 5db4d33 + e30d78b commit 53d8c12

File tree

5 files changed

+134
-1
lines changed

5 files changed

+134
-1
lines changed

src/assets/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@
395395
}
396396

397397
#reference-page ul {
398-
margin-top: 0.5em;
398+
margin-top: 0;
399399
}
400400

401401
div.reference-group {
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @name Parametric Equations
3+
* @description A parametric equation is where x and y
4+
* coordinates are both written in terms of another letter. This is
5+
* called a parameter and is usually given in the letter t or θ.
6+
* The inspiration was taken from the YouTube channel of Alexander Miller.
7+
*/
8+
9+
function setup(){
10+
createCanvas(720,400);
11+
}
12+
13+
// the parameter at which x and y depends is usually taken as either t or symbol of theta
14+
let t = 0;
15+
function draw(){
16+
background('#fff');
17+
translate(width/2,height/2);
18+
stroke('#0f0f0f');
19+
strokeWeight(1.5);
20+
//loop for adding 100 lines
21+
for(let i = 0;i<100;i++){
22+
line(x1(t+i),y1(t+i),x2(t+i)+20,y2(t+i)+20);
23+
}
24+
t+=0.15;
25+
}
26+
// function to change initial x co-ordinate of the line
27+
function x1(t){
28+
return sin(t/10)*125+sin(t/20)*125+sin(t/30)*125;
29+
}
30+
31+
// function to change initial y co-ordinate of the line
32+
function y1(t){
33+
return cos(t/10)*125+cos(t/20)*125+cos(t/30)*125;
34+
}
35+
36+
// function to change final x co-ordinate of the line
37+
function x2(t){
38+
return sin(t/15)*125+sin(t/25)*125+sin(t/35)*125;
39+
}
40+
41+
// function to change final y co-ordinate of the line
42+
function y2(t){
43+
return cos(t/15)*125+cos(t/25)*125+cos(t/35)*125;
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @name Parametric Equations
3+
* @description A parametric equation is where x and y
4+
* coordinates are both written in terms of another letter. This is
5+
* called a parameter and is usually given in the letter t or θ.
6+
* The inspiration was taken from the YouTube channel of Alexander Miller.
7+
*/
8+
9+
function setup(){
10+
createCanvas(720,400);
11+
}
12+
13+
// the parameter at which x and y depends is usually taken as either t or symbol of theta
14+
let t = 0;
15+
function draw(){
16+
background('#fff');
17+
translate(width/2,height/2);
18+
stroke('#0f0f0f');
19+
strokeWeight(1.5);
20+
//loop for adding 100 lines
21+
for(let i = 0;i<100;i++){
22+
line(x1(t+i),y1(t+i),x2(t+i)+20,y2(t+i)+20);
23+
}
24+
t+=0.15;
25+
}
26+
// function to change initial x co-ordinate of the line
27+
function x1(t){
28+
return sin(t/10)*125+sin(t/20)*125+sin(t/30)*125;
29+
}
30+
31+
// function to change initial y co-ordinate of the line
32+
function y1(t){
33+
return cos(t/10)*125+cos(t/20)*125+cos(t/30)*125;
34+
}
35+
36+
// function to change final x co-ordinate of the line
37+
function x2(t){
38+
return sin(t/15)*125+sin(t/25)*125+sin(t/35)*125;
39+
}
40+
41+
// function to change final y co-ordinate of the line
42+
function y2(t){
43+
return cos(t/15)*125+cos(t/25)*125+cos(t/35)*125;
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @name Parametric Equations
3+
* @description A parametric equation is where x and y
4+
* coordinates are both written in terms of another letter. This is
5+
* called a parameter and is usually given in the letter t or θ.
6+
* The inspiration was taken from the YouTube channel of Alexander Miller.
7+
*/
8+
9+
function setup(){
10+
createCanvas(720,400);
11+
}
12+
13+
// the parameter at which x and y depends is usually taken as either t or symbol of theta
14+
let t = 0;
15+
function draw(){
16+
background('#fff');
17+
translate(width/2,height/2);
18+
stroke('#0f0f0f');
19+
strokeWeight(1.5);
20+
//loop for adding 100 lines
21+
for(let i = 0;i<100;i++){
22+
line(x1(t+i),y1(t+i),x2(t+i)+20,y2(t+i)+20);
23+
}
24+
t+=0.15;
25+
}
26+
// function to change initial x co-ordinate of the line
27+
function x1(t){
28+
return sin(t/10)*125+sin(t/20)*125+sin(t/30)*125;
29+
}
30+
31+
// function to change initial y co-ordinate of the line
32+
function y1(t){
33+
return cos(t/10)*125+cos(t/20)*125+cos(t/30)*125;
34+
}
35+
36+
// function to change final x co-ordinate of the line
37+
function x2(t){
38+
return sin(t/15)*125+sin(t/25)*125+sin(t/35)*125;
39+
}
40+
41+
// function to change final y co-ordinate of the line
42+
function y2(t){
43+
return cos(t/15)*125+cos(t/25)*125+cos(t/35)*125;
44+
}

src/templates/pages/reference/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ slug: reference/
44
---
55

66
<div id="reference-page">
7+
78
{{> sidebar}}
89

910
<div class="column-span">

0 commit comments

Comments
 (0)