transformInternal method

  1. @override
double transformInternal (
  1. double t
)
override

Returns the value of the curve at point t, in cases where 1.0 > t > 0.0.

Implementation

@override
double transformInternal(double t) {
  double start = 0.0;
  double end = 1.0;
  while (true) {
    final double midpoint = (start + end) / 2;
    final double estimate = _evaluateCubic(a, c, midpoint);
    if ((t - estimate).abs() < _cubicErrorBound)
      return _evaluateCubic(b, d, midpoint);
    if (estimate < t)
      start = midpoint;
    else
      end = midpoint;
  }
}