ShapeFunction

class ShapeFunction(val functions: SortedMap<Double, UnivariateFunction>, val extrapolateX: Boolean = false, val extrapolateY: Boolean = false) : BivariateFunction

The bivariate shape function is defined by a list of functions that are parallel to the y axis and placed at different positions on the x axis.

Parameters

functions

univariate functions parallel to the y axis, whereas the key denotes the location on the x axis

extrapolateX

if true, the last (or first) function is used when exceeding (or falling below)

extrapolateY

if true, the last (or first) value is used, which is still within the domain of the respective function

Constructors

Link copied to clipboard
constructor(functions: SortedMap<Double, UnivariateFunction>, extrapolateX: Boolean = false, extrapolateY: Boolean = false)

Properties

Link copied to clipboard
open override val domainX: Range<Double>

function's domain for x

Link copied to clipboard
open override val domainY: Range<Double>

function's domain for y

Link copied to clipboard
val extrapolateX: Boolean = false
Link copied to clipboard
val extrapolateY: Boolean = false
Link copied to clipboard

Functions

Link copied to clipboard
fun value(x: Double, y: Double): Either<Exception, Double>

Returns the value z = f(x, y). If x is not in domainX or y is not in domainY an error is returned.

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

Returns the value z = f(x, y). If x is not in domainX or y is not in domainY an error is returned. However, a fuzziness is allowed with a certain tolerance.