/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{Seconds as t}from"../../core/time.js";class i{constructor(i,o,s){this._initialVelocity=i,this._stopVelocity=o,this.friction=s,this._duration=t(Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this.friction)))}get duration(){return this._duration}isFinished(t){return t>this.duration}value(t){return this.valueFromInitialVelocity(this._initialVelocity,t)}valueDelta(t,i){const o=this.value(t);return this.value(t+i)-o}valueFromInitialVelocity(t,i){i=Math.min(i,this.duration);const o=1-this.friction;return t*(o**i-1)/Math.log(o)}}export{i as Momentum};
