functionpolynomialFunction
Polynomial function of degree n
Extends from BusinessSimulation.Icons.Function (Icon for functions).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The function returns the value of the n-th degree polynomial given the real input x and the real vector of coefficients a[:] = {a_0, a_1, ..., a_n} where the degree of the polynomial is n = size(a,1) - 1.
Syntax
Functions.polynomialFunction(x,a);
Examples
Functions.polynomialFunction( 2, { 0,0,1}); // 4.0
Functions.polynomialFunction( 2, {-6,1,1}); // 0.0
See also
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x | Independent variable | |
| Real[:] | a | Vector of coefficients |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | y | Value of the polynomial equation |