export class Interpolator {
    constructor(getter, setter, vTo, nCycles) {
        this.getter = getter;
        this.setter = setter;
        this.vTo = vTo;
        this.nCycles = nCycles;
    }
    initialize() {
        this.vFrom = this.getter();
    }
    interpolate(cycle) {
        if (cycle === 0)
            this.initialize();
        const interpolated = this.vFrom + (cycle + 1) * (this.vTo - this.vFrom) / this.nCycles;
        this.setter(cycle, interpolated);
    }
}
//# sourceMappingURL=Interpolator.js.map