Is it possible to input equations for a program?

Hello,

I'm trying to make a program where a set of [v,t] data is inputted as variables needed for calculations in my program.

So I was wondering is it possible to input a v(t) function that represent this [v,t] data, for example v = 3+5t+4sin(t) into my program?

Another way to do this I thought was to input a set of [v,t] data as inputs and then generate a function from inside the program?

Thank you for your help I'm just looking for general answers since I don't even know if doing this is possible, so would just like more experienced programmer's inputs?

Thanks again
It's possible, but it's not easy.
You need an expression parser. There are three ways to do it:
1. Write your own. Hard.
2. Find one written by someone else. Easy to medium, but it may be difficult to find one suiting your requirements.
3. Generate one with Yacc/Bison. Medium. You can generate one that perfectly matches your needs, but you'll need to learn to use Yacc or Bison.
Topic archived. No new replies allowed.