Poly Method
Evaluates a polynomial with given coefficients at a specified point.
Definition
Namespace: GHost.GSharp.Analytics.AF
Assembly: GHost.GSharp.Analytics.AF (in GHost.GSharp.Analytics.AF.dll) Version: 1.2.0.0 (1.2.44.3)
C#
public static double Poly(
double x,
Object coefficients
)
VB
Public Shared Function Poly (
x As Double,
coefficients As Object
) As Double
Parameters
- Double
- Point where the polynomial needs to be evaluated.
- Object
- An array of coefficients defining the polynomial, starting with the 0-th order term.
Return Value
Double
Value of the polynomial, defined by the the given coefficients, at a specified point x.
Remarks
If x or any coefficient is not numeric, throws an exception.
Example
C#
double[] coefficients = [1.0, 2.0, 3.0, 4.0];
double result;
result = Poly(1.0, coefficients); // 'Returns 10.0
result = Poly(0.0, coefficients); // 'Returns 1.0
Exceptions
| ArgumentException |