Re:Show HN: Algebra.js – Build, display, and solve algebraic...
by nicolewhite on Saturday August 15, 2015 @09:58AM
(#10065375)
Yes, 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/47b6cbba375...
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).