jiggzson / nerdamer

a symbolic math expression evaluator for javascript
http://www.nerdamer.com
MIT License
517 stars 82 forks source link

Solving linear equation that contains "pi" fails #556

Closed ElectrifyPro closed 3 years ago

ElectrifyPro commented 4 years ago

Using solve() on 4x+2y=2 works for both variables:

nerdamer('solve(4x + 2y = 2, x)') // [(-1/4)*(-2+2*y)]
nerdamer('solve(4x + 2y = 2, y)') // [(-1/2)*(-2+4*x)]

Using solve() on 4x+2y*pi=2 does not work:

nerdamer('solve(4x + 2y*pi = 2, x)') // [(-1/2)*(-1+y),0], but should be: [(2 - 2y*pi) / 4]
nerdamer('solve(4x + 2y*pi = 2, y)') // [-(-1+2*x),0], but should be: [(2 - 4x) / (2pi)]