CPolynomial:Copy


The Copy method duplicates the polynomial coefficients and returns the new copy.

Syntax

P = CPolynomial:Copy()

bullet.gif    P is a new CPolynomial containing the same coefficients as the current one.

Example

The following script duplicates the coefficient set P into a new set P2:

P = new_polynomial()

-- create a CPolynomial

P:Set( 0, 5.5 )

-- set coef[0]

P:Set( 1, 0.144 )

-- set coef[1]

P:Set( 4, -1.045e-6)

-- set coef[4]

P2 = P:Copy()

-- creates a duplicate coefficient set named P2

Printf("N = %d", P2:Count())

-- result: N = 3

P:delete()

-- if finished with P, clean up memory

Related Topics

CPolynomial


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