"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Interpolator = void 0;
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);
    }
}
exports.Interpolator = Interpolator;
//# sourceMappingURL=Interpolator.js.map