Last updated
Was this helpful?
Last updated
Was this helpful?
The Polynomial
class provides a framework for representing and manipulating polynomials in one variable. It supports essential mathematical operations such as addition, multiplication, differentiation, and evaluation. The class is designed for single-threaded use.
This class enables the addition of polynomials or individual terms, allowing for the construction of complex polynomial expressions. It supports multiplication with other polynomials or individual terms, making it versatile for algebraic operations. Additionally, users can find roots of a polynomial using Newton's method, which provides precision control through configurable error margins and iteration limits.
The class also offers methods to compute and retrieve the derivative of a polynomial. The derivative can be further evaluated at specific points to analyze its behavior. Users can reset the polynomial to zero when needed, providing a clean state for new calculations.
Adds another polynomial to this polynomial.
Parameters
Returns: void
Sample
Adds a term to this polynomial.
Parameters
Returns: void
Sample
Finds a root of this polynomial using Newton's method, starting from an initial search value, and with a given precision.
Parameters
Sample
Returns a polynomial that holds the derivative of this polynomial.
Sample
Returns the value of the derivative of this polynomial in a certain point.
Parameters
Sample
Returns the value of this polynomial in a certain point.
Parameters
Sample
Multiplies this polynomial with another polynomial.
Parameters
Returns: void
Sample
Multiples this polynomial with a term.
Parameters
Returns: void
Sample
Sets this polynomial to zero.
Returns: void
Sample
polynomial ;
coefficient ;
exponent ;
startValue ;
error ;
iterations ;
Returns: The root value after the specified number of iterations or as soon as the error condition is satisfied. Returns Double.NaN if the derivative was zero during the computation.
Returns: A polynomial representing the derivative of this polynomial.
x ;
Returns: The value of the derivative of this polynomial at the specified point.
x ;
Returns: The value of this polynomial at the specified point.
polynomial ;
coefficient ;
exponent ;
void
Adds another polynomial to this polynomial.
void
Adds a term to this polynomial.
Finds a root of this polynomial using Newton's method, starting from an initial search value, and with a given precision.
Returns a polynomial that holds the derivative of this polynomial.
Returns the value of the derivative of this polynomial in a certain point.
Returns the value of this polynomial in a certain point.
void
Multiplies this polynomial with another polynomial.
void
Multiples this polynomial with a term.
void
Sets this polynomial to zero.