Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi.

If I enter a function into a textbox, for example f(x) = 3x+1 where the 3x+1 is the part entered into the text box. How can I from that calculate the values for x = 2, x = 3 and so on so I can stor the values in array.

 

Im making a application that will plot the function intp a graph so I need to calculate som of the values the function will return so I can plot it.

 

If im not clear in my text respond and I'll try to explain more. Thanks for any help that will be given to me.

 

//A

Posted

You'll need to parse the entered formula and then apply values to the variables detected. Don't forget your order of operations! If you search around the web, you might be able to find someone who has done this already and you can leverage their code or at least get some ideas.

 

You will probably find a stack structure useful for determining order of operations as you parse.

Posted
Thanks! I will look in to it. I want to try it befor looking at others work. I will now been googleing parse formula and look up stacking in my old programming book.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...