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
.
Functions.polynomialFunction(x,a);
Functions.polynomialFunction( 2, { 0,0,1}); // 4.0
Functions.polynomialFunction( 2, {-6,1,1}); // 0.0
function polynomialFunction extends BusinessSimulation.Icons.Function; input Real x "Independent variable"; input Real a[:] "Vector of coefficients"; output Real y "Value of the polynomial equation"; end polynomialFunction;