derivativeAt method
Vector2
derivativeAt(})
override
Returns the tangent vector at parameter t
.
The return value is not normalized. The optional parameter cachedFirstOrderDerivativePoints
allows the method to use previously calculated values for firstOrderDerivativePoints instead
of repeating the calculations.
Implementation
@override
Vector2 derivativeAt(double t,
{List<Vector2>? cachedFirstOrderDerivativePoints}) {
final derivativePoints =
cachedFirstOrderDerivativePoints ?? firstOrderDerivativePoints;
final result = Vector2.zero();
Vector2.mix(derivativePoints[0], derivativePoints[1], t, result);
return result;
}