Reputation: 67
Is there a java library that expand mathematical equations?
for example
(x – 4)^2 + (y + 1)^2 = 9
i would like to output the developed form
x^2 + y^2 – 8x + 2y + 8 = 0
Upvotes: 3
Views: 1123
Reputation: 3819
What you're looking for is tool for performing "Symbolic Math".
A quick search revealed a couple of options:
Hope that helps.
Edit: This question was closed so I originally posted this as a comment.
Upvotes: 2
Reputation: 58451
What you are looking for is called Computer Algebra System.
I just googled "Java Computer Algebra System" and the first hit was symja. I haven't tried it.
If this library is not appropriate for you then you find a list of CAS software on Wikipedia.
As @Justin points out, a related question is: Is there something like Sympy for Java?
Upvotes: 2
Reputation: 4531
This is string manipulation, not mathematical term manipulation. You will likely have to write one yourself. There are several ways of doing this, with varying degrees of interesting-ness
Upvotes: -1