Diff

open class Diff : UnaryFunction

Performs numerical differentiation of a value with respect to time (sec). Supports a low-pass filter which can be used to smoothen out results from the derivative.

Author

Lucas Bubner, 2025

Since

7.0.0

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Default low-pass gain to use when applying the derivative.

Inherited properties

Link copied to clipboard
A function that cubes the input value.
Link copied to clipboard
A function that cubes the input value and keeps the sign.
Link copied to clipboard
The identity function that simply returns the input value.
Link copied to clipboard
A function that negates the input value.
Link copied to clipboard
A function that squares the input value.
Link copied to clipboard
A function that squares the input value and keeps the sign.

Functions

Link copied to clipboard
open fun apply(input: Double): Double
Applies this function to the input value and returns the result.
Link copied to clipboard
open fun getLast(): Double
Link copied to clipboard
open fun setLowPassGain(gain: Double)
Set a new Low Pass filter gain for use with derivative readings.

Inherited functions

Link copied to clipboard
Creates a composite function h(x) such that h(x) = f(x) / g(x).
open fun div(divisor: Double): UnaryFunction
Creates a composite function h(x) such that h(x) = 1/k * f(x).
Link copied to clipboard
Creates a composite function h(x) such that h(x) = f(x) ^ g(x).
open fun exp(exponent: Double): UnaryFunction
Creates a composite function h(x) such that h(x) = f(x) ^ k.
Link copied to clipboard
Creates a composite function h(x) such that h(x) = f(x) * g(x).
open fun mult(multiplier: Double): UnaryFunction
Creates a composite function h(x) such that h(x) = k * f(x).
Link copied to clipboard
Constructs a new function that first calls this function, then passes the result to another as input.