2 ms·
Cardanos equation is complete, but only under the assumption that complex numbers exist, however, the same is true for the formula of closed-form solutions of q
by Gladdyu 11y ago
Cardanos equation is complete, but only under the assumption that complex numbers exist, however, the same is true for the formula of closed-form solutions of quadratic equations. The difference is that Cardanos equation might make use of complex numbers but in the end, returns a real solution whereas the quadratic solver remains complex whenever D < 0.
So in order to implement qubic equations you'd need (a) support for complex numbers, even though the final solution might be real and (b) support for reducing (square and higher order) roots. (b) would be a very valuable addition, as it also allows you to incorporate equations like x^2 - 2 = 0 which solves to x = sqrt(2) or x = -sqrt(2).
- nicolewhite 11y agoYes, thank you for the clarification. Maybe "incomplete" was the wrong word; I was referring to the note on the Wikipedia page: > At this point, Cardano, who did not know complex numbers, supposed that the roots of this equation were real, that is that q^2/4 + p^3/27 > 0. I actually had initial plans to do it Cardano's way: I added a Complex class for the very situation you described[0], but ended up abandoning it as the trig solution seemed more straightforward. [0] https://github.com/nicolewhite/algebra.js/commit/47b6cbba37523da89b0228e050a9ed02e4dcb6a1 https://github.com/nicolewhite/algebra.js/commit/47b6cbba375...