openrndr / org.openrndr.math / safeDerivative

safeDerivative

fun safeDerivative(p0: Vector2, c0: Vector2, p1: Vector2, t: Double): Vector2 (source)
fun safeDerivative(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: Double): Vector2 (source)

like derivative but handles cases in which p0/p1 or p2/p3 coincide