Class QuadraticRoot

    • Constructor Detail

      • QuadraticRoot

        public QuadraticRoot()
    • Method Detail

      • solve

        public List<Number> solve​(Polynomial polynomial,
                                  double epsilon)
        Solve \(ax^2 + bx + c = 0\).
        Parameters:
        polynomial - a quadratic equation to be solved
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
        Returns:
        the roots of the quadratic equation
        Throws:
        IllegalArgumentException - if the polynomial degree is not 2