Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit ebf3c870 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

change signature of VectoMath::QuadraticEquationSolver,

butfix in equation
parent e9881cbb
Branches
Tags
No related merge requests found
......@@ -67,20 +67,20 @@ namespace TUGraz.VectoCore.Utils
return Math.Atan(inclinationPercent).SI<Radian>();
}
public static List<PerSecond> QuadraticEquationSolver(double a, double b, double c)
public static List<double> QuadraticEquationSolver(double a, double b, double c)
{
var retVal = new List<PerSecond>();
var retVal = new List<double>();
var D = b * b - 4 * a * c;
if (D < 0) {
return retVal;
} else if (D > 0) {
// two solutions possible
retVal.Add((-b + Math.Sqrt(D) / (2 * a)).SI<PerSecond>());
retVal.Add((-b - Math.Sqrt(D) / (2 * a)).SI<PerSecond>());
retVal.Add((-b + Math.Sqrt(D)) / (2 * a));
retVal.Add((-b - Math.Sqrt(D)) / (2 * a));
} else {
// only one solution possible
retVal.Add((-b / (4 * a * c)).SI<PerSecond>());
retVal.Add((-b / (4 * a * c)));
}
return retVal;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment