Exemple #1
0
        public void QuadraticEquationTest()
        {
            //equation 2x^2+3x-1
            var result = EquationSolver.QuadraticEquation(2, 3, -1);

            Assert.IsTrue(result[0].Real.ApproximatelyEquals(-1.78077640640442, 1e1 - 0));
            Assert.IsTrue(result[0].Imaginary.ApproximatelyEquals(0, 1e1 - 0));

            Assert.IsTrue(result[1].Real.ApproximatelyEquals(0.280776406404415, 1e-10));
            Assert.IsTrue(result[1].Imaginary.ApproximatelyEquals(0, 1e1 - 0));
        }