Comments (9)
More generally,I propose complex numbers shouldn't be in the core. Many of the functions written for real numbers don't apply the same way for complex numbers.
from nerdamer.
Why can't we write a test case for this identity? If we were to move complex numbers from the core then where would be a more appropriate place? An add-on?
from nerdamer.
Fundamentally, when nerdamer's parser takes in an expression. It assumes the expression is in the set of real numbers. However, it doesn't account for complex numbers.
For example:
abs(i+1) doesn't do anything
cos(i+1) doesn't do anything
I guess we have to rewrite a lot of functions to take complex numbers
Also
(-1)^x => -1
Something is wrong with exponents.
from nerdamer.
I see what you mean. Wouldn't it just be better to extend the functions in the core to deal with those cases? I can't think of a way to deal with complex numbers any other way. (-1)^x is a bug and should be addressed.
from nerdamer.
Ok, I agree to extend the core since Solve.js might use a lot of complex numbers.
from nerdamer.
var e = nerdamer('e^x',{x:6}).evaluate();
console.log(e.valueOf());
"e^6"
It doesn't evaluate exponents at all.
from nerdamer.
You never specified what e is. Unless you're looking for the mathematical constant e. In that case it's accessed using capital letters (E). Same as for pi (PI). Also regarding detecting this identity and others. I think they should be checked for as an option since the overhead for detecting them might be a bit much.
from nerdamer.
I made the mistake of not making capitalizing E.
I think the key for solving these bugs could be euler's identity.
Any equation (a+bi)^(f(x)) could be turned to exponential format to cartesian format.
(-1)^x => E^(i*PI*x) => cos(PI*x) + i*sin(PI*x)
Just turn everything into cartesian format at the end.
from nerdamer.
Brosnan, the issue should be closed. Let me know if the latest implementation solves your issue.
from nerdamer.
Related Issues (20)
- Limit of ((x^2)/(x+1))-((x^2+2)/(x+3)) in inifinity returns -infinity instead of 2
- How to clear defined functions ? HOT 2
- Add Types for nerdamer/all Algebra Extra Solve and Calculus HOT 2
- Error while parsing latex HOT 2
- Function returned from `buildFunction` returns `null` HOT 4
- dot() and cross() don't work with unknowns as parameters HOT 1
- vector addition with an unknown variable HOT 5
- Reference error in SolveFor
- Simplify
- Simplify Error HOT 1
- HUGE error on solveFor HOT 1
- Errors with solveEquations
- Override Physical Constants
- nerdamer.diff("x * sqrt(y)","x") function returning incorrect expression during partial differentiation if the constant term in the equation (in this case sqrt(y)) is under square root HOT 1
- nerdamer.variables error
- SolveEquations not solving correctly
- Invalid latex generated for natural log
- solveEquations not working with too complex equation
- integration result incorrect HOT 1
- Error in basic algebra result
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nerdamer.