- download the code
- make a funktion with the calculation you want to graff
- it must return the value for the y axis
- go to sketch.js
- in the function fill operation add two things:
- the operation array must have the string "simple"
- the calculate array must have the name of your function WITHOUT ()
these have precisly 2 or 0 y values per x value
- in the function you must now have 2 calculatins and 1 variable
- this variable is a boolian that switches between the 2 results for the y axis
- the funktion must be stored in the same way as with normal lines
- the operation array is should have "multy" instead of "simple" for a optimal result
- it is a good idea to make a local variable when x is used but it is not required
- you can use functions from refractions to do recursive math operations, but a lot of them are available with Math.
- there may not be an empty space in the operation or calculate array, the array possition has no meaning. as long as it starts at 0
- the lines already being calculated can be deleted and are only there to showcase the way it works
- a function should also contain a stroke (R,G,B) or a stroke (W) to choose the color of the line