Function Plotter

nims11

BIOS Terminator
I wrote this function plotter for my Csc school project. It takes mathematical function(any function of 'x' containing brackets, basic operators(+,-,/,*,^), trigo functions, log,floor,ceil) from the user in form of a string and then evaluates it and plots it in a graph. My program supports multiple plotting of graph and allows graph manipulation options like increasing precision, zooming in/out and shifting.

i want to share this with you guyz.

The main challenge(which ) of this program was "How do i evaluate a mathematical function from a string without restricting the functions inputted by user" which i solved by writing a header file for string evaluation. it has few minor bugs which i will resolve after my board exams.

please run it and let me know of bugs and features that can be added. Should i upload the code too?(its quite shabby and even i confuse sometimes with it).

i have attached the compiled '.exe'.
to avoid bugs, enclose the unary functions in a bracket. eg . x-sin(x) gives a wrong plot(i still need to figure out why) but writing it as x-(sin(x)) works properly.
Function Plotter
 

furious_gamer

Excessive happiness
I wrote this function plotter for my Csc school project. It takes mathematical function(any function of 'x' containing brackets, basic operators(+,-,/,*,^), trigo functions, log,floor,ceil) from the user in form of a string and then evaluates it and plots it in a graph. My program supports multiple plotting of graph and allows graph manipulation options like increasing precision, zooming in/out and shifting.

i want to share this with you guyz.

The main challenge(which ) of this program was "How do i evaluate a mathematical function from a string without restricting the functions inputted by user" which i solved by writing a header file for string evaluation. it has few minor bugs which i will resolve after my board exams.

please run it and let me know of bugs and features that can be added. Should i upload the code too?(its quite shabby and even i confuse sometimes with it).

i have attached the compiled '.exe'.
to avoid bugs, enclose the unary functions in a bracket. eg . x-sin(x) gives a wrong plot(i still need to figure out why) but writing it as x-(sin(x)) works properly.
Function Plotter

That is how programs work basically. Ever heard about precedence, then you shouldn't have asked this question.

Read This
 
OP
nims11

nims11

BIOS Terminator
Precedence not a problem. i have well defined it in my code. The problem is that i have not considered '-' as an operator because it can conflict with negative numbers. wherever '-' was used as an operator, i replaced it with(+-). like a-b was evaluated as a+(-b). Everything works fine until a unary function is introduced after a '-'.
even x+sin(x) or x*sin(x) or x-x^2 works fine but program fails when evaluating functions like - .....-sin(x).....
 

Sid

Broken In
Hi,

Tried out the application. Will need the code to understand how you are evaluating the given function.

I tried out giving the input as : x + sin(-x) : which gave the correct plot. Now as this is equivalent to : x - sin(x).

Therefore kinda unsure why it fails to plot the correct values.

So if you upload the code, please add the comments. Secondly, i want to know if you have read about expression evaluation using binary trees. This comes under infix, postfix, prefix expression evaluation. If you haven't used this technique of solving the expression, I suggest you read up on that and implement it.
 
Let me comment my source code and i will upload it 2mrw

ok . will try to compile with dev-c++ and VC++.

my c++ and c# programs always work. no issues with other exe's or any virus (that i know of).

most proably the file was changed.

you should zip/rar the exe and then upload it again. never leave exe on sharing site , it may become contaminated.
 
Top Bottom