Package-level declarations

Math utilities shared across the module: state-space discretization, a DARE solver plus cost/covariance matrix helpers for LQRController/KalmanFilter, and interpolation utilities including InterpolatingMap/InterpolatingMap2D and linear/spline/bilinear lerp functions.

Types

Link copied to clipboard

A navigable map that supports flexible interpolation between values.

Link copied to clipboard
class InterpolatingMap2D(interpolate: (Double, Double, Double, Double, Double, Double) -> Double, grid: TreeMap<Double, TreeMap<Double, Double>> = TreeMap())

Functions

Link copied to clipboard
fun antiLerp(value: Double, low: Double, high: Double): Double
Link copied to clipboard
fun bilerp(x: Double, y: Double, x0: Double, y0: Double, x1: Double, y1: Double, q00: Double, q10: Double, q01: Double, q11: Double): Double
Link copied to clipboard
fun lerp(low: Double, high: Double, t: Double): Double
fun lerp(value: Double, inputMin: Double, inputMax: Double, outputMin: Double, outputMax: Double): Double
Link copied to clipboard
fun lerpLookup(source: List<Double>, target: List<Double>, query: Double): Double

Searches for the nearest value in source to the given query value. If query exactly matches a value in source, the corresponding value in target is returned. If not, the two nearest values in source are found, and linear interpolation is performed between the corresponding values in target.

Link copied to clipboard
fun <R : Nat, C : Nat> lerpMatrix(t: Double, low: Matrix<R, C>, high: Matrix<R, C>): Matrix<R, C>

Linearly interpolates between two matrices at value t.

Link copied to clipboard
fun <U : Unit<U>> lerpMeasure(t: Double, low: Measure<U>, high: Measure<U>): Measure<U>

Linearly interpolates between two measures at value t.

Link copied to clipboard
fun splerp(t: Double, p0: Double, p1: Double, p2: Double, p3: Double): Double