CPolynomial:Init


The Init method sets the first n coefficients to the same target value.

Syntax

CPolynomial:Init( n, value )

bullet.gif    n is the number of coefficients to set.

bullet.gif    value is the target value to assign to the first n coefficients.

Example

The following script initializes through 4-th order (the first 5 indices) to 1.0:

 

P = new_polynomial()

-- create a CPolynomial

P:Init( 5, 1.75)

-- set first 5 values to 1.75

Printf("coef[3]= %lg", P:Get(3))

-- result: coef[3] = 1.75

Related Topics

CPolynomial, Set


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