Please note that this question is different from this question. This one asks for graphical output, while the other one asks for ascii art.
Objective
Help! Timmy's graphing calculator broke! His calculator cannot graph anymore. However, he has found a way to add new programs and functions to his calculator. Your job is to write a program/function that graphs equations.
Rules
- Your program/function should take in a string in the form of
"y = random equation involving x"
and graph it on the coordinate grid. - Timmy's calculator doesn't have that much memory, so please try to make your code as short as possible.
- The operations needed are addition (
+
), subtraction (-
), multiplication (*
), division (/
), exponentiation(^
) and grouping(()
) - Your program/function should be able to graph from
x=-5
tox=5
, and fromy=-5
toy=5
. - Color, axis labels, the grid, numbers, scale, and animation are optional.
- The minimum size of the image should be 50x50 pixels.
Test Cases
Input
y = x ^ 2
Output
Input
y = 4 * x + 3
Output
Standard loopholes apply.
You may change the operators, but it adds +10% to your byte count.
y = 0.01*x
? And what abouty = 1000*x
? Snould all boundaries be[-5, 5][-5, 5]
regardless of what the function is? \$\endgroup\$