You are here: Symbol Reference > Polynoms Namespace > Functions > Polynoms.PolyEval Function
MtxVec VCL
ContentsIndex
PreviousUpNext
Polynoms.PolyEval Function

Evaluates a polynomial with coefficients Coeff at complex value Val and returns complex results.

Pascal
function PolyEval(Val: TCplx; Coeff: TVec): TCplx; overload;

Evaluates a polynomial with coefficients Coeff at complex value Val and returns complex results.

uses MtxExpr, Math387, MtxVec, MtxVecEdit, MtxVecTee,Polynoms; procedure TForm1.Button1Click(Sender: TObject); var X, Y, Coeff: Vector; begin X := Ramp(10,-5,1); // X = [-5,-4,-3,-2,-1, 0, 1, 2, 3, 4] // construct a parabola Coeff.SetIt(false,[2, -1, 3]); PolyEval(X,Coeff,Y); // Y now holds the values of polynomial, evaluated at all X.Values DrawIt(X,Y,'Parabola'); end;
#include "MtxExpr.hpp" #include "Polynoms.hpp" #include "MtxVecTee.hpp" #include "MtxVecEdit.hpp" void __fastcall TForm1::BitBtn1Click(TObject *Sender) { sVector X,Y,Coeff; X.Size(10,false); X.Ramp(-5,1); // X = [-5,-4,-3,-2,-1, 0, 1, 2, 3, 4] // construct a parabola Coeff.SetIt(false,OPENARRAY(double,(2, -1, 3))); PolyEval(X,Coeff,Y); // Y now holds the values of polynomial, evaluated at all X.Values DrawIt(X,Y,"Parabola",false); }
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!