Package org.chsrobotics.lib.math
Class PolynomialInterval
java.lang.Object
org.chsrobotics.lib.math.PolynomialInterval
Representation of a standard polynomial function, with restrictions on the upper and lower limits
of the domain.
-
Constructor Summary
ConstructorsConstructorDescriptionPolynomialInterval
(Map<Integer, Double> terms) Constructs a PolynomialInterval. -
Method Summary
-
Constructor Details
-
PolynomialInterval
Constructs a PolynomialInterval.- Parameters:
terms
- A map of exponent degrees to the coefficient associated with them. For example, the equation2x^5 - 3x + 5
would be encoded as a map of(5,2), (1,-3), (0,5)
. Exponents can be negative, but care should be taken to avoid domain issues (0 should not be part of the allowable values if there are negative exponents).
-
-
Method Details
-
sample
Samples the polynomial at a certain value.- Parameters:
reference
- The value to sample the polynomial for.- Returns:
- The output of the polynomial function.
-