nerdamer icon indicating copy to clipboard operation
nerdamer copied to clipboard

Reference error in SolveFor

Open Matt0017 opened this issue 2 years ago • 0 comments


> `ReferenceError: i is not defined
>     at eval (eval at build (nerdamer.core.js:11882:1), <anonymous>:3:184)
>     at Object.getPoints (Solve.js:938:1)
>     at solve (Solve.js:1538:1)
>     at Expression.core.Expression.solveFor (Solve.js:257:1)
>     at App.DeterminePOE_Internal (App.js:537:1)
>     at App.DeterminePOE (App.js:474:1)
>     at App.updateXDotExpression (App.js:620:1)
>     at onChange (App.js:735:1)
>     at HTMLUnknownElement.callCallback (react-dom.development.js:4161:1)
>     at Object.invokeGuardedCallbackDev (react-dom.development.js:4210:1)`

Issue occurs when trying to solve for 'y' the following:

(((-abs(-y^2+1/2)-y^2+1/2)^(1/3)+(-y^2+1/2+abs(-y^2+1/2))^(1/3))*((1/2)*i*sqrt(3)+1/2)^2)^3-1+2*((-abs(-y^2+1/2)-y^2+1/2)^(1/3)+(-y^2+1/2+abs(-y^2+1/2))^(1/3))^2*((1/2)*i*sqrt(3)+1/2)^4

which is the result from substituting

x = ((-abs(-y^2+1/2)-y^2+1/2)^(1/3)+(-y^2+1/2+abs(-y^2+1/2))^(1/3))*((1/2)*i*sqrt(3)+1/2)^2 into -1+2*x^2+x^3

Even if this doesn't work, it'd be better to just throw the error, that way I can catch it and do something when this is happening.

Matt0017 avatar May 15 '22 08:05 Matt0017