Class Polynomial
Defined in: Polynomial.js.
Constructor Attributes  Constructor Name and Description 

Polynomial(terms)
Constructs a polynomial, simply a set of terms

Field Attributes  Field Name and Description 

<static> <constant> 
Polynomial.serializeName
A static constant to help with de/serialization

Method Attributes  Method Name and Description 

add(summand)
Adds one of several object to a polynomial


degree()
Provides the Polynomials degree


{double}

degreeCoeff(n)
Returns the coefficient of the polynomial of the first term of degree n

divide(denominator)
Division of a Polynomial by a number or term.


exponentiate(exponent)
Produce powers of polynomials, only works with integers currently


<static> 
Polynomial.fromWebWorker(that)
Finish reconstituting a Polynomial after passing to a web worker

LagrangeInterpolation(points)
Generates a polynomial given an array of points using the Lagrange Interpolation Method


leastSquare(points, bases)
Generate a function of least squares for given data points and given basis functions


multiply(multiplicand)
Multiply a polynomial by something


{Polynomial[]}

orthogonalPolynomials(points, power)
Generate orthogonal polynomials to assist least square methods

{double  object}

resolve(value)
Evaluates the polynomial for value value

{String[]}

Generates an array of serialized terms

simplify()
Due to the implmentation of some of the mathematical operations they generate
unsimplified polynomials.


sort()
Due to the implmentation of the mathematical operations terms are not in
any sorted order.


subtract(subtrahend)
Subtract one of several object to a polynomial


{string}

toString()
Generates a string representation of the Polynomial

{Object}

Custom JSON representation to handle passing to web workers

Class Detail
Polynomial(terms)
Constructs a polynomial, simply a set of terms
 Parameters:
 {Term[]} terms
 An array of Term objects
Field Detail
<static> <constant>
Polynomial.serializeName
A static constant to help with de/serialization
Method Detail
{Polynomial}
add(summand)
Adds one of several object to a polynomial
 Parameters:
 {TermPolynomialnumber} summand
 A Term, or Polynomial, or number to be added
 Returns:
 {Polynomial} The sum
degree()
Provides the Polynomials degree
{double}
degreeCoeff(n)
Returns the coefficient of the polynomial of the first term of degree n
 Parameters:
 {integer} n
 Returns:
 {double}
{Polynomial}
divide(denominator)
Division of a Polynomial by a number or term. Division by a polynomial is a much
more complicated case and so is not handled here because it isn't needed in this program.
 Parameters:
 {Termnumber} denominator
 The denominator
 Returns:
 {Polynomial} The quotient
{Polynomial}
exponentiate(exponent)
Produce powers of polynomials, only works with integers currently
 Parameters:
 {Integer} exponent
 the power to be raised by
 Returns:
 {Polynomial} The resulting polynomial
<static>
Polynomial.fromWebWorker(that)
Finish reconstituting a Polynomial after passing to a web worker
 Parameters:
 {Object} that
 A polynomial stripped of methods
{Polynomial}
LagrangeInterpolation(points)
Generates a polynomial given an array of points using the Lagrange Interpolation Method
 Parameters:
 {Point[]} points
 The points to be interpolated
 Returns:
 {Polynomial} The function interpolating the points.
{Polynomial}
leastSquare(points, bases)
Generate a function of least squares for given data points and given basis functions
 Parameters:
 {Point[]} points
 A sorted array of points
 {Polynomial[]} bases
 The basis functions
 Returns:
 {Polynomial} The method of least square distance from all of the points
{Polynomial}
multiply(multiplicand)
Multiply a polynomial by something
 Parameters:
 {PolynomialTermnumber} multiplicand
 The item to be multiplied by
 Returns:
 {Polynomial} The product
{Polynomial[]}
orthogonalPolynomials(points, power)
Generate orthogonal polynomials to assist least square methods
 Parameters:
 {Number[]} points
 The x values of data to be interpolated
 {Integer} power
 The highest power of orthogonal polynomial desired
 Returns:
 {Polynomial[]} The orthogonal functions
{double  object}
resolve(value)
Evaluates the polynomial for value value
 Parameters:
 {double  object} value
 The value to be applied to the function/polynomial
 Returns:
 {double  object} the result
{String[]}
serialize()
Generates an array of serialized terms
 Returns:
 {String[]} The array of serialized terms
simplify()
Due to the implmentation of some of the mathematical operations they generate
unsimplified polynomials. This corrects that.
sort()
Due to the implmentation of the mathematical operations terms are not in
any sorted order. This sorts them.
{Polynomial}
subtract(subtrahend)
Subtract one of several object to a polynomial
 Parameters:
 {TermPolynomialnumber} subtrahend
 A Term, or Polynomial, or number to be added
 Returns:
 {Polynomial} The difference
{string}
toString()
Generates a string representation of the Polynomial
 Returns:
 {string} The string representation
{Object}
toWebWorker()
Custom JSON representation to handle passing to web workers
 Returns:
 {Object} For JSON.stringify