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 )

bullet.gif    n is the index of the coefficient to retrieve.

bullet.gif    value is the numeric value of the coefficient.

bullet.gif    On success, the coefficient value is returned.

bullet.gif    On failure, 0 is returned.

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 returns the value of coefficient 1:

 

P = new_polynomial()

-- 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


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.