|
-
Oct 9th, 2009, 11:49 AM
#1
Thread Starter
Junior Member
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
-
Oct 9th, 2009, 11:56 AM
#2
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.
-
Oct 9th, 2009, 11:59 AM
#3
Thread Starter
Junior Member
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!!!
-
Oct 9th, 2009, 12:00 PM
#4
Re: Equations..
Here's an algorithm to help you understand how this can be accomplished:
http://en.wikipedia.org/wiki/Shunting_yard_algorithm
From my burrow, 2 feet under.
-
Oct 9th, 2009, 12:09 PM
#5
Thread Starter
Junior Member
Re: Equations..
Thanks!!! This is helpful...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|