# PolynomialFunction

data class PolynomialFunction(val coefficients: DoubleArray, val domain: Range<Double> = Range.all()) : UnivariateFunction

Polynomial function of form f(x) = c0 + c1*x + c2*x^2 + ... + c\[N]*x^N.

#### Parameters

coefficients

coefficients for f(x), whereby coefficients0 corresponds to c0

domain

domain for which the polynomial function is defined

## Constructors

Link copied to clipboard
constructor(coefficients: List<Double>)
constructor(coefficients: DoubleArray, domain: Range<Double> = Range.all())

## Types

Link copied to clipboard
object Companion

## Properties

Link copied to clipboard
Link copied to clipboard
val degree: Int

degree of the polynomial function

Link copied to clipboard
open override val domain: Range<Double>
Link copied to clipboard
val endValue: Either<Exception, Double>

endValue = f(upper endpoint of domain).

Link copied to clipboard

startValue = f(lowest endpoint of domain).

## Functions

Link copied to clipboard
operator fun div(m: Double): StackedFunction
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
fun slope(x: Double): Either<Exception, Double>

Evaluation of the slope = f'(x) with strict checking whether x is within the function's domain.

Link copied to clipboard
fun slopeInFuzzy(x: Double, tolerance: Double): Either<Exception, Double>

Evaluation of the slope = f(x) with fuzzy checking whether x is within the function's domain.

Link copied to clipboard
operator fun times(m: Double): StackedFunction
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
operator fun unaryMinus(): StackedFunction
Link copied to clipboard
fun value(x: Double): Either<Exception, Double>

Evaluation of z = f(x) with strict checking whether x is within the function's domain.

Link copied to clipboard
open fun valueInFuzzy(x: Double, tolerance: Double): Either<Exception, Double>

Evaluation of z = f(x) with fuzzy checking whether x is within the function's domain.

Link copied to clipboard

Returns the calculated value of f(x), if x is within the function's domain. Otherwise null is returned.