calculateAngularSpeed method

dynamic calculateAngularSpeed(
  1. dynamic p0,
  2. dynamic p1,
  3. dynamic t0,
  4. dynamic t1,
)

Calculate the angular speed @param {Number} p0 Position at t0 @param {Number} p1 Position at t1 @param {Number} t0 Initial time in milliseconds @param {Number} t1 Ending time in milliseconds

Implementation

calculateAngularSpeed(p0, p1, t0, t1) {
  var s = p1 - p0;
  var t = (t1 - t0) / 1000;
  if (t == 0) {
    return 0;
  }

  return s / t;
}