var i;
for ( i = 0; i >= -10; i -= 1 )
{
line[ floor( x / 2 ) + i ] -= i^2;
}
for ( i = 1; i <= 10; i += 1 )
{
line[ floor( x / 2 ) + i ] += i^2;
}So each cell of this line-array contains the height of one "dot" of the line. With this code, the line goes wavy and the center (i=0) is the highest point but it should be the lowest.
This is how the curve should be:

but this is how gm draws it:

I've never been good at mathematics so can someone help me?











