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

Returns coefficients of the characteristic polynomial.

Pascal
procedure PolyCoeff(Mtx: TMtx; Coeff: TVec); overload;

Returns coefficients of the characteristic polynomial: det( Mtx - Lambda * I ).

Find coefficients of a polynomial with roots at 1,1 and 2.

uses MtxExpr, Math387, MtxVec, MtxVecEdit, Polynoms; procedure TForm1.Button1Click(Sender: TObject); var Roots, Coeff: Vector; begin // roots of the polynomial: (x - 1)*(x - 1)*(x - 2) Roots.SetIt(false,[1, 1, 2]); PolyCoeff(Roots,Coeff); // Coeff returns the coefficients of the polynomial [ 1,-4, 5,-2] // which can be written as: 1*x^3 + -4*x^2 + 5*x - 2 ViewValues(Coeff,'Coefficients'); end;
#include "MtxExpr.hpp" #include "Polynoms.hpp" #include "MtxVecTee.hpp" void __fastcall TForm1::BitBtn1Click(TObject *Sender) { Vector Roots, Coeff; // roots of the polynomial: (x - 1)*(x - 1)*(x - 2) Roots.SetIt(false,OPENARRAY(double,(1, 1, 2))); PolyCoeff(Roots,Coeff); // Coeff returns the coefficients of the polynomial [ 1,-4, 5,-2] // which can be written as: 1*x^3 + -4*x^2 + 5*x - 2 ViewValues(Coeff,"Coefficients"); }
Examples on GitHub

Find coefficients of a characteristic polynomial:

uses MtxExpr, Math387, MtxVec, MtxVecEdit, Polynoms; var Coeff: Vector; A: Matrix; begin A.SetIt(3,3,false,[1, 4, -1, 2, 1, 5, 3, -2, 0]); PolyCoeff(A,Coeff); ViewValues(Coeff,'Coefficients'); end;
#include "MtxExpr.hpp" #include "Polynoms.hpp" #include "MtxVecTee.hpp" void __fastcall TForm1::BitBtn1Click(TObject *Sender) { sVector Coeff; sMatrix A; A.SetIt(3,3,false,OPENARRAY(double,(1, 4, -1, 2, 1, 5, 3, -2, 0))); PolyCoeff(A,Coeff); ViewValues(Coeff,"Coefficients"); }
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!