function clamp(input, minimum, maximum) {
  return Math.min(Math.max(input, minimum), maximum);
}
function positiveModulo(numerator, denominator) {
  return (numerator % denominator + denominator) % denominator;
}
function getPercent(value, total) {
  return value / total * 100;
}
function lerp(start, end, progress) {
  const clampedProgress = clamp(progress, 0, 100);
  return start + (end - start) / 100 * clampedProgress;
}
function multiLerp(breakpoints, progress) {
  const clampedProgress = clamp(progress, 0, 100);
  const breakpointSpacing = 100 / (breakpoints.length - 1);
  const previousBreakpointIndex = Math.floor(clampedProgress / breakpointSpacing);
  const nextBreakpointIndex = previousBreakpointIndex + 1;
  if (previousBreakpointIndex === breakpoints.length - 1) {
    return breakpoints[breakpoints.length - 1];
  }
  const previousBreakpoint = breakpoints[previousBreakpointIndex];
  const nextBreakpoint = breakpoints[nextBreakpointIndex];
  const previousBreakpointPercent = breakpointSpacing * previousBreakpointIndex;
  const pointProgress = (clampedProgress - previousBreakpointPercent) * (100 / breakpointSpacing);
  return lerp(previousBreakpoint, nextBreakpoint, pointProgress);
}
export {
  clamp,
  getPercent,
  lerp,
  multiLerp,
  positiveModulo
};
//# sourceMappingURL=maths.js.map
