Package util

Class Polynomial


  • public class Polynomial
    extends Object
    Represents a polynomial of any degree
    Author:
    Christoph Schimeczek
    • Constructor Detail

      • Polynomial

        public Polynomial​(List<Double> prefactorsInAscendingDegree)
        Creates a polynomial of any degree, e.g. a + b*x + c*x**2 + d*x**3, from a List of doubles
        Parameters:
        prefactorsInAscendingDegree - list of i.e. (a,b,c,d) in the above example
      • Polynomial

        public Polynomial​(double[] prefactorsInAscendingDegree)
        Creates a polynomial of any degree, e.g. a + b*x + c*x**2 + d*x**3, from an array of doubles
        Parameters:
        prefactorsInAscendingDegree - array of i.e. [a,b,c,d] in the above example
    • Method Detail

      • evaluateAt

        public double evaluateAt​(double x)
        Evaluates polynomial function value at given position
        Parameters:
        x - position to evaluate polynomial
        Returns:
        value of the polynomial at x