/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

/**
 * Performs linear interpolation between start and end values based on progress.
 *
 * @param start - Starting value
 * @param end - Ending value
 * @param progress - Interpolation progress (0-1)
 * @returns Interpolated value
 */
export function lerp( start, end, progress ) {
	return start + ( end - start ) * progress;
}

/**
 * Creates a lerp function with fixed start and end values.
 *
 * @param start - Starting value
 * @param end - Ending value
 * @returns Function that takes progress (0-1) and returns interpolated value
 */
export function createLerp( start, end ) {
	return progress => lerp( start, end, progress );
}
