.Spot.Base.Math.polyCoefReal

Information

The function determines the coefficients c of a polynomial of degree n from its real root vector r.

  c_0 + c_1*x + c_2*x^2 + ... + c_n*x^n.

The resulting n+1 coefficients are c[k], k=1 .. n+1, normalised such that the highest coefficient is one.

  c[n+1] = 1

Example

Real[3] r={1,2,3}; Real[4] c; algorithm c := Spot.Functions.polyCoefReal(r);

The resulting n+1 = 4 coefficients are:

c = {-6, 11, -6, 1};

See also polyCoef, polyRoots

Interface

function polyCoefReal
  extends Icons.Function;
  input Real[:] r "root vector";
  output Real[size(r, 1) + 1] c "coefficient vector";
end polyCoefReal;

Generated at 2024-04-24T18:15:52Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos