transformInternal method

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

Returns the value of the curve at point t.

The given parametric value t will be between 0.0 and 1.0, inclusive.

Implementation

@override
double transformInternal(double t) {
  final seconds = t * kTgSpring.inMilliseconds / 1000;
  final decay = _zeta * _omega;
  final omegaD = _omega * math.sqrt(1 - _zeta * _zeta);
  final envelope = math.exp(-decay * seconds);
  return 1 -
      envelope *
          (math.cos(omegaD * seconds) +
              decay / omegaD * math.sin(omegaD * seconds));
}