VERY Simple Polynomial Function Grapher




determines the value of the exponent. (exponents higher than 3 not supported)

determines if the function is positive or negative

Draws the function given the specified inputs

As canvas graphics are rendered using the top left pixel as 0,0, the function, to appear centered, needs to start out with the coordinate pair (250, 250). that is why the horizontal/vertical shift inputs are like that. also to note that because 0,0 is on the top left of the canvas, the y value is inverted. as in, reducing the number causes the function to 'go up' on the y axis rather than generally expected behavior. every coordinate pair is printed to the console (you might notice that the y value is printed twice. this is because each half of the parabola are generated seperately from eachother. you also might notice they go quite ridiculously high. this is to prevent any unwanted behavior with the function not fully exiting the edges of the canvas


kitsunami of sonic the hedgehog comic book fame