Cardano's algorithm for finding the roots for a cubic polynomial

This jsbin shows the intersection between a cubic Bezier curve and a line, computed using Cardano's algorithm for finding the roots for a cubic polynomial. The procedure is expertly explained here, and makes root finding for cubic Beziers really easy. Since intersection detection is simply root finding for a curve with the curve reoriented along the intersecting line, Cardano's algorithm can help us quite well there, too, and will be more efficient than performing iterative Newton-Raphson root finding.