Replies: 1 comment
-
|
Mathjs doesn't have a ready made function to normalize a polynomial. It would be an interesting addition. It could be interesting to see if we can improve Docs: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My application needs a way to extract the coefficients from a polynomial string after it has been simplified, math.simplify is producing some peculiar looking results:
1 - z^4 + z^5 - z^6 + z^2 - 7z^2 - z^8 simplifies to 1 + z ^ 5 + -z ^ 8 - 6 * z ^ 2 - (z ^ 4 + z ^ 6)
I am not sure what else it could look like so I am not comfortable using it just yet. I would prefer a more predictable form where the coefficients can be easily extracted, something like 1 + z ^ 5 - z ^ 8 - 6 * z ^ 2 - z ^ 4 - z ^ 6 would be better.
For general polynomials something like each term satisfying the regex
(coefficient)?(\*)?(variable(\^number)?)? and joined by + would be good. Is there some way of doing this or if not would you consider adding something like this? If so I would be willing to help.
Thanks,
Tom
Beta Was this translation helpful? Give feedback.
All reactions