I try to import a mathematic function into Javascript. It's the following formula: http://www.wolframalpha.com/input/?i=-0.000004x%5E2%2B0.004x
Example Values:
f(0) = 0
f(500) = 1
f(1000) = 0
So that is my function:
function jumpCalc(x) {
return (-0.004*(x^2)+4*x)/1000;
}
The values are completely wrong.
Where is my mistake? Thanks.