Re: Drawing curves with equation.
- To: mathgroup@smc.vnet.net
- Subject: [mg11393] Re: [mg11371] Drawing curves with equation.
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Sun, 8 Mar 1998 20:13:17 -0500
- References: <199803070706.CAA28448@smc.vnet.net.>
Olivier Gilloire wrote: > > Hi, > > I'm a c++ programmer, and I would like to learn how to draw a curve > corresponding to an equation, given in a string format like "x^2". > > My problem is not how to draw the curve, but rather how to analyze the > string and interpret it as a mathematic equation. > > code samples are welcome !! > > Olivier Gilloire If I understand you correctly, then all you need is ToExpression which converts strings to expressions. string="x^2" Plot[ToExpression[string],{x,0,3}] returns a nice plot of x^2 -- Remove the _nospam_ in the return address to respond.
- References:
- Drawing curves with equation.
- From: "Olivier Gilloire" <ogilloire@sysenhance.com>
- Drawing curves with equation.