normalAt method

Vector2 normalAt(
  1. double t, {
  2. List<Vector2>? cachedFirstOrderDerivativePoints,
})

The normal vector of the curve at parameter value t.

The return value is normalized. See derivativeAt for information about the optional parameter cachedFirstOrderDerivativePoints.

Implementation

Vector2 normalAt(double t,
    {List<Vector2>? cachedFirstOrderDerivativePoints}) {
  final d = derivativeAt(t,
      cachedFirstOrderDerivativePoints: cachedFirstOrderDerivativePoints)
    ..normalize();
  return Vector2(-d.y, d.x);
}