Package org.moddingx.libx.util.math
Class Polynomial<T extends Number>
java.lang.Object
org.moddingx.libx.util.math.Polynomial<T>
- All Implemented Interfaces:
Function<T,
,T> UnaryOperator<T>
- Direct Known Subclasses:
DoublePolynomial
,IntPolynomial
Represents a polynomial with coefficients of type
T
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Polynomial<T>
add
(Polynomial<T> other) Adds two polynomials together.Gets the coefficients of this polynomial.abstract Polynomial<T>
Computes the derivative of this polynomial.abstract Polynomial<T>
multiply
(Polynomial<T> other) Multiplies two polynomials.abstract Polynomial<T>
negate()
Negates this polynomial.subtract
(Polynomial<T> other) Subtracts two polynomials from each other.toString()
-
Constructor Details
-
Polynomial
protected Polynomial()
-
-
Method Details
-
coefficients
Gets the coefficients of this polynomial. For example, the coefficients[2, 0 1]
represent the polynomial2x²+1
. -
derivative
Computes the derivative of this polynomial. -
negate
Negates this polynomial. -
add
Adds two polynomials together. -
subtract
Subtracts two polynomials from each other. -
multiply
Multiplies two polynomials. -
toString
-