2D Function Plotter
Ed Mackey has created a function plotter application, which plots 2D maths functions on to a graph using canvas.

Graph plotting using canvas
The function plotter allows for scrolling, stretching and zooming with the mouse and will automatically rescale the grid lines. There are a variety of preset functions to try, or you can enter your own.


Comments
Shaun
Looking through the source code it looks as though var x is defined in the plot() method and then isnt actually used. how is the scaling being applied to xPos?
Great app though.
Posted on January 26, 2010
Ed Mackey
Shaun, the variable x, which appears unused, is actually the main “x” that’s used by the formulas being evaluated. In other words “x” is being used by the Eval() call in that plot() function (for most formulas). The other ones, xPos and yPos, are the corresponding canvas pixel locations, and their relationship to x and y are determined by the zoom and stretch levels.
Posted on January 28, 2010
Related demos