CPolynomial:Exists CPolynomial:Init

CPolynomial:Get


The Get method returns the coefficient value at a specified index, beginning at index 0.

Syntax

value = CPolynomial:Get( n )

Remarks

If the value n is not a valid index, for example, n < 0, this method returns 0.

Example

Suppose a CPolynomial assigned to P contains 4 coefficients. This following script fragment returns the value of coefficient 1:

 

P = CPolynomial:new()

-- create a CPolynomial

P:Set( 0, 5.5)

-- set coef[0]

P:Set( 1, 0.144)

-- set coef[1]

P:Set( 6, -0.15221e-12)

-- set coef[6]

Printf("v = %lg", P:Get(1))

-- result: v = 0.144

Related Topics

CPolynomial