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

Term(coefficient, power, variable)
Constructor for a term of a polynomial

Field Attributes  Field Name and Description 

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

Method Attributes  Method Name and Description 

add(summand)
Adds a term,polynomial, or constant to an existing term


degree()
Returns the monomial's degree


divide(denominator)
Divide a term by another term or a constant


{Term}

exponentiate(exponent)
Produce powers of a Term

<static> 
Term.fromWebWorker(that)
Reattaches class methods to destringified object

initTerm(sterm)
This is an alternate constructor to initialize Term objects.


multiply(multiplicand)
Multiply a term, Polynomial, or constant to an existing term


{Term}

neg()
Returns the additive invese of the term

{doubleTerm}

resolve(value)

{String}

Generate a formated string representing a term.

subtract(summand)
Subtract a term, or constant from an existing term


{String}

toString()
Generates a pretty printed version of the term.

{Object}

Stringify the object but with additional property to help deserialization

Class Detail
Term(coefficient, power, variable)
Constructor for a term of a polynomial
 Parameters:
 {double} coefficient
 The coefficient of the term.
 {doubledouble[]} power
 The power of the variable in the term.
 {stringstring[]} variable
 The name of the variable involved in the term
Field Detail
<static> <constant>
Term.serializeName
A static constant to help with de/serialization
Method Detail
{TermPolynomial}
add(summand)
Adds a term,polynomial, or constant to an existing term
 Parameters:
 {TermPolynomialdouble} summand
 The summad being added to the term
 Returns:
 {TermPolynomial} The result of the summation
degree()
Returns the monomial's degree
{TermPolynomial}
divide(denominator)
Divide a term by another term or a constant
 Parameters:
 {Termdouble} denominator
 The denominator of the divisor
 Returns:
 {TermPolynomial} The quotient
{Term}
exponentiate(exponent)
Produce powers of a Term
 Parameters:
 {Integer} exponent
 the power to be raised by
 Returns:
 {Term} the power of the input
<static>
Term.fromWebWorker(that)
Reattaches class methods to destringified object
 Parameters:
 {Object} that
 A Term stripped of methods
initTerm(sterm)
This is an alternate constructor to initialize Term objects.
This is meant to be used in conjunction witht the serialize() method
 Parameters:
 {String} sterm
 A string of the form ax^b where a,b are floats, and x is any variable
{TermPolynomial}
multiply(multiplicand)
Multiply a term, Polynomial, or constant to an existing term
 Parameters:
 {TermPolynomialdouble} multiplicand
 The multiplicand in the product
 Returns:
 {TermPolynomial} The product
{Term}
neg()
Returns the additive invese of the term
 Returns:
 {Term}
{doubleTerm}
resolve(value)
 Parameters:
 {doubleObject} value
 Evaluate the term for the value
 Returns:
 {doubleTerm} The result of the function
{String}
serialize()
Generate a formated string representing a term.
 Returns:
 {String} Return the term in formatted string
{TermPolynomial}
subtract(summand)
Subtract a term, or constant from an existing term
 Parameters:
 {Termdouble} summand
 The summand being subtract from the term
 Returns:
 {TermPolynomial} The result of the summation
{String}
toString()
Generates a pretty printed version of the term.
 Returns:
 {String} Returns a string version of the term
{Object}
toWebWorker()
Stringify the object but with additional property to help deserialization
 Returns:
 {Object} object to JSON stringify