You need to enable JavaScript to run this app.
The curve is defined by:
\text{The curve is defined by:}
The curve is defined by:
{
x
=
∑
i
=
1
3
s
i
n
(
t
10
i
)
y
=
∑
i
=
1
3
c
o
s
(
t
10
i
)
\begin{cases} x = \sum_{i=1}^{3} sin(\frac{t}{10i})\\ y = \sum_{i=1}^{3} cos(\frac{t}{10i}) \end{cases}
{
x
=
∑
i
=
1
3
s
in
(
10
i
t
)
y
=
∑
i
=
1
3
cos
(
10
i
t
)
155 / 1656
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
// Player Settings
s
.
start
=
153
;
s
.
duration
=
378
+
5
*
225
;
s
.
rate
=
1
;
s
.
frameRate
=
60
;
s
.
webgl
=
false
;
// Setup the P5.js Sketch
let
particles
=
[
]
;
p
.
setup
=
(
)
=>
{
// Convenience functions like `latex` are available.
p
.
staticText
(
"The curve is defined by:"
,
16
,
16
)
;
// Demonstrate our system of equations
p
.
latex
(
`\\
begin
{
cases
}
$
{
x1Latex
}
\\\\
$
{
y1Latex
}
\\
end
{
cases
}
`
,
16
,
48
)
;
// This is where things that don't need to happen each frame should be called.
for
(
let
i
=
0
;
i
<
width
/
10
;
i
++
)
{
particles
.
push
(
new
Particle
(
))
;
}
}
;
p
.
draw
=
(
t
,
nextT
)
=>
{
// WebGL origin is the center.
if
(
p
.
isWebGL
(
))
{
p
.
translate
(
-
p
.
width
/
2
,
-
p
.
height
/
2
)
}
// Draw the background each frame
p
.
background
(
'#0f0f0f'
)
;
// Plot our function based on the current time.
plot
(
t
)
;
// Update our particles
for
(
let
i
=
0
;
i
<
particles
.
length
;
i
++
)
{
// Draw particles
particles
[
i
]
.
drawParticle
(
)
;
// Move them according to the current time
particles
[
i
]
.
moveParticle
(
t
)
;
// Draw connecting lines
particles
[
i
]
.
joinParticles
(
particles
.
slice
(
i
))
;
}
}
;
// Change the color and stroke according to fraction of drawn plot.
const
fadingGradient
=
(
fraction
,
_
)
=>
{
p
.
stroke
(
p
.
lerpColor
(
p
.
color
(
'#277DA1'
)
,
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX