jiggzson / nerdamer

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

exp(i + x pi) gives sin(π⋅x)⋅i+cos(π⋅x) #560

Closed dromastyx closed 3 years ago

dromastyx commented 4 years ago

Hi, thanks for this great project. I think there might be an error with the exp function: exp(i + x pi) gives the same expression as exp(i pi x), which is sin(π⋅x)⋅i+cos(π⋅x). Then if we, for example, evaluate exp(i + pi), we get -1, which I think is incorrect.

jiggzson commented 4 years ago

@dromastyx, you're right. I think this is related to a misinterpretation of Euler's identity within nerdamer. I'll take a look at it. Thanks for reporting.