Results 1 to 6 of 6
Thread: Output Equations in Java
- 10-26-2010, 10:17 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 2
- Rep Power
- 0
Output Equations in Java
Hello,
I was wondering if anyone knew of a library that could take an equation like
Java Code:x = (-b +- (b^2-4ac)^(1/2))/2
And turned it into something like:

Preferably I would not like the output to be an image, but an image output is fine. I just wanted to check if something like this exists before I start coding it myself.
Thanks
- 10-28-2010, 10:27 PM #2
Member
- Join Date
- Oct 2010
- Posts
- 2
- Rep Power
- 0
Would this be a better placed question somewhere else?
- 11-02-2010, 12:23 PM #3
Member
- Join Date
- Oct 2010
- Posts
- 11
- Rep Power
- 0
hey,
first.I can't help you.But what do you want to achieve.That the parameters in this new Form will be valuable themselfs? If you know what i mean?
- 11-02-2010, 12:33 PM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
There are some packages in Java, that you can draw equations, graphs, shapes, etc.. Search on Google.
David J. Eck
- 11-02-2010, 02:17 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
I once generated html version 3.2. tags from an infix expression (there's a little thread about it in the AWT/Swing forum). First the infix expression was parsed to its abstract syntax tree; a visitor would visit all the nodes (where the nodes would tell the visitor their type of node) and html code was generated. It turned out a bit of a mess because html 3.2 isn't well suited to mark up mathematical expressions. Here's an example: the expression:
is compiled to an AST; the postfix form of the AST is:Java Code:((-b + sqrt(b**2-4*a*c))/2*a)
(note: +- is the token for the unary minus operator) and the html output is:Java Code:b +- b 2 ** 4 a * c * - sqrt + 2 / a *
As I wrote: html isn't the best output for mathematical infix expressions. If you can, select another output form. Parsing the infix expression is just standard technology (my version is a recursive descent parser).Java Code:(-<i>b</i>+<font color="#cc"><b>√</b></font>(<i>b</i><sup><font color="#8000">2</font></sup>−<font color="#8000">4</font>· <i>a</i>·<i>c</i>)) ⁄ <font color="#8000">2</font>·<i>a</i>
kind regards,
Jos
- 11-02-2010, 03:24 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
Similar Threads
-
linear systems of equations
By tyang in forum New To JavaReplies: 2Last Post: 03-24-2010, 03:13 PM -
Finding the intercept using two equations.
By MapleLeafRag in forum New To JavaReplies: 1Last Post: 12-03-2009, 08:32 PM -
Java, output string, getting correct output? HELP!
By computerboyo in forum New To JavaReplies: 2Last Post: 02-25-2009, 11:44 PM -
Solving this equations problem in Java
By matt_well in forum New To JavaReplies: 17Last Post: 08-30-2008, 09:05 PM -
equations
By Peter in forum New To JavaReplies: 2Last Post: 07-04-2007, 06:15 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks