Members
dt
A gloabl vairable which stores the time step per frame
frequencyChanged
A global variable that checks if the frequency of the wave has been changed
by the user
kx
A gloabl vairable that changes the frequency of the lissajous pattern in
the x direction
ky
A gloabl vairable that changes the frequency of the lissajous pattern in
the y direction
phaseX
A gloabl vairable that stores the relative phaxe of the x component of the
wave with respect to zero
phaseY
A gloabl vairable that stores the relative phaxe of the y component of the
wave with respect to zero
posArray
A gloabl vairable that stores all the previous positions of the "electron"
posArrayLen
A gloabl vairable that dictates how many previous values of the electrons
position shall be saved.
time
A gloabl vairable that scales the amount of time that has passed so that it
is more suitable for the lissajous pattern to be visible
Methods
draw()
A p5.js function that renders the changes to the canvas.
mouseClicked()
A p5.js function that passes mouse click information to the progeram. In
this case it is being used to adjust the x and y frequency of the wave if
the mouse is over the sliders.
setup()
A p5.js function the is used to setup the canvas
xslider()
Draws the x frequency slider on the bottom of the canvas
yslider()
Draws the y frequency slider on the side of the canvas