And can you give me an example of an algorithm?
EDIT: And then how would I calculate the math using Javascript? Can someone add that? Sorry to not include that context originally..
NOTE: I am using 'flot' to graph it and the input for flot is a javascript array like this:
[[x,y],[x,y],[x,y]...]
So given the values that change the curve I output all the points to an array with a loop and spit it out to flot to graph.