I'm trying to find the roots of a cubic polynomial ax^3+bx^2+cx+d=0
using math.numerics. The package is great, but I'm struggling to get started with it. Please can someone explain how to find the roots, and a simple explanation on how to run the sample package from Github?
I've added a reference to the package
using MathNet.Numerics;
and this is what I've tried:
var roots = FindRoots.Cubic(d, c, b, a);
double root1=roots.item1;
double root2=roots.item2;
double root3=roots.item3;
but I get an error "The type 'Complex' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Numerics'"
. Adding using System.Numerics gives an error and doesn't solve the problem.
Any suggestions please?