-
Equations..
I have a problem for which I hope there is a simple fix...
I have created a program that allows teachers/students to graph and print many different types of equations and functions that one would find in a typical HS math course...I have created interfaces for many different types of graphs such as polynomial functions, exponential functions, polar equations...etc.
What I want to do now is allow users to input the right hand side of an equation and have the program graph it for them...just like a typical graphing calculator. My question is how to read a string of numbers, operations, variables and grouping symbols from a textbox...Will I have to parse out every character and treat it separately or is there a simpler solution.
Ex: I want them to type in something like: 2x^4+3x(2x-5)/12
Thanks!!! Mike
-
Re: Equations..
This is one of those instances where parsing out everything one by one may be easier since there's little in the way of patterns you'd be able to pick out.
-
Re: Equations..
Thanks...I had a feeling that was what I would need to do....I always wondered how TI did that on the graphing calculators...I was hoping for an easier way!!!
-
Re: Equations..
Here's an algorithm to help you understand how this can be accomplished:
http://en.wikipedia.org/wiki/Shunting_yard_algorithm
-
Re: Equations..
Thanks!!! This is helpful...