Constructor
new Poly(degs, coefs, orderopt, coefTypeopt)
Properties:
| Name | Type | Description |
|---|---|---|
degs |
Array.<number> | Array of degrees (integers). |
coefs |
Array.<any> | Array of coefficients corresponding to degrees. |
o |
number | Truncation order O(X^n). |
coefType |
function | The coefficient type constructor. |
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
degs |
Array.<number> | Array of degrees (integers). |
||
coefs |
Array.<any> | Array of coefficients corresponding to degrees. |
||
order |
number |
<optional> |
Infinity
|
Truncation order O(X^n). |
coefType |
function |
<optional> |
bf
|
the coef type |
Classes
Members
denseCoefs
- Description:
Returns a dense array of coefficients up to the highest degree. Note: Throws if polynomial contains negative powers. Use offsetCoefs for Laurent series.
- Source:
Returns a dense array of coefficients up to the highest degree. Note: Throws if polynomial contains negative powers. Use offsetCoefs for Laurent series.
offsetCoefs
- Description:
Returns a dense array of coefficients along with the valuation offset. Supports negative degrees.
- Source:
Returns a dense array of coefficients along with the valuation offset. Supports negative degrees.
Methods
acos() → {Poly}
Returns:
- Type
- Poly
add(other) → {Poly}
Parameters:
| Name | Type | Description |
|---|---|---|
other |
Poly | number | any |
Returns:
- Type
- Poly
asin() → {Poly}
- Description:
Arcsine: asin(P(x)) asin(P) = int( P' / sqrt(1 - P^2) ) + asin(P(0))
- Source:
Returns:
- Type
- Poly
atan() → {Poly}
- Description:
Arctangent: atan(P(x)) atan(P) = int( P' / (1 + P^2) ) + atan(P(0))
- Source:
Returns:
- Type
- Poly
cos() → {Poly}
- Description:
Cosine: cos(P(x)) cos(c0 + V) = cos(c0)cos(V) - sin(c0)sin(V)
- Source:
Returns:
- Type
- Poly
degree() → {number}
Returns:
- -1 if zero polynomial.
- Type
- number
deriv() → {Poly}
Returns:
- Type
- Poly
div(other, defaultLimitopt) → {Poly}
- Description:
Division: A / B Supports Exact Polynomials (Euclidean/Laurent) and Truncated Series.
Logic: Uses "Synthetic Division" from lowest degree upwards (Series Division).
- If both A and B are Exact (Order=Infinity):
- Tries to divide exactly.
- If remainder becomes 0, returns Exact result (Order=Infinity).
- If infinite expansion (e.g. 1/(1-x)), stops at defaultLimit and returns Series (Order=Limit).
- If one/both are Series (Finite Order):
- Calculates terms up to the theoretical precision limit.
- If both A and B are Exact (Order=Infinity):
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
other |
Poly | |||
defaultLimit |
number |
<optional> |
100
|
Max terms to calculate for infinite exact expansions. |
Returns:
- Type
- Poly
equals(other, cmpopt) → {boolean}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
other |
Poly | number | BigFloat | Complex | The object to compare with. |
|
cmp |
function |
<optional> |
Optional comparator (a, b) => boolean. Defaults to checking a.equals(b) or strict equality. |
Returns:
- Type
- boolean
eval(x) → {any}
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | BigFloat | Complex |
Returns:
- Type
- any
exp() → {Poly}
- Description:
Exponential Function: e^P(x) e^(c0 + V) = e^c0 * e^V e^V = 1 + V + V^2/2! + V^3/3! + ...
- Source:
Returns:
- Type
- Poly
integ() → {Poly}
- Description:
Formal Integration int ( c * x^k ) = (c / (k+1)) * x^(k+1) Constant term set to 0.
- Source:
Returns:
- Type
- Poly
log() → {Poly}
- Description:
Natural Logarithm: ln(P(x)) Uses Derivative-Integration method: ln(P) = int( P' / P ) dx + ln(P(0))
- Source:
Returns:
- Type
- Poly
mul(other) → {Poly}
Parameters:
| Name | Type | Description |
|---|---|---|
other |
Poly | number | any |
Returns:
- Type
- Poly
neg() → {Poly}
Returns:
- Type
- Poly
operatorAdd()
operatorDiv()
operatorMul()
operatorNeg()
operatorPow()
operatorSub()
pow(n, dopt) → {Poly}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
n |
number | The exponent. |
||
d |
number |
<optional> |
1
|
The denominator of the exponent. |
Returns:
- Type
- Poly
powSeries(n, dopt) → {Poly}
- Description:
Power for Series: P(x)^(n/d) Supports negative and fractional powers.
Requirements:
- Must be a Series (Order != Infinity).
- Resulting valuation must be integer.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
n |
number | Numerator |
||
d |
number |
<optional> |
1
|
Denominator |
Returns:
- Type
- Poly
sin() → {Poly}
Returns:
- Type
- Poly
sub(other) → {Poly}
Parameters:
| Name | Type | Description |
|---|---|---|
other |
Poly | number | any |
Returns:
- Type
- Poly
tan() → {Poly}
Returns:
- Type
- Poly
toString(radixopt, precisionopt, prettyopt) → {string}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
radix |
number |
<optional> |
10
|
|
precision |
number |
<optional> |
20
|
|
pretty |
boolean |
<optional> |
true
|
pretty print |
Returns:
- Type
- string
valuation() → {number}
- Description:
Returns the "Valuation" (degree of the lowest non-zero term).
- Source:
Returns:
- Infinity if Exact Zero, or n if O(X^n).
- Type
- number
(static) O(n, coefTypeopt) → {Poly}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
n |
number | The order of the truncation. |
||
coefType |
function |
<optional> |
BigFloat
|
The coefficient type. |
Returns:
- Type
- Poly
(static) X(nopt, coefTypeopt) → {Poly}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
n |
number |
<optional> |
1
|
The degree of X. |
coefType |
function |
<optional> |
BigFloat
|
The coefficient type. |
Returns:
- Type
- Poly