I'm trying to figure out how to parse an input string that contains a math equation given by the user like 2x^2+3x+6
to a double that operates the String with its variables that I will define later on with a for loop.
Basically,
for(x=0;x<=100;x++){
String equation = "2x^2+3x+6";
double y = equation;
System.out.println("Your point is x: " + x +" | Y: " + y);
}
I found this old post but the BeanSheel Library only allowed me to use actual numbers without parameters like "x"
.
So what I'm trying to achieve is a program that will draw a function given by the user. But for the drawing part I'm fine