core / com.acmerobotics.roadrunner.util / MathUtil

MathUtil

object MathUtil

Various math utilities.

Functions

numericalDerivative

fun numericalDerivative(x: List<Double>, y: List<Double>): List<Double>

Numerically compute dy/dx from the given x and y values. The returned list is padded to match the length of the original sequences.

solveQuadratic

fun solveQuadratic(a: Double, b: Double, c: Double): List<Double>

Returns the real solutions to the quadratic ax^2 + bx + c.