"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clamp = clamp; exports.lerp = lerp; /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ /** * Return `value` unless it is less than `minimum`, in which case return `minimum` or unless it is greater than `maximum`, in which case return `maximum`. */ function clamp(value, minimum, maximum) { return Math.max(Math.min(value, maximum), minimum); } /** * linearly interpolate between `a` and `b` at a ratio of `ratio`. If `ratio` is `0`, return `a`, if ratio is `1`, return `b`. */ function lerp(a, b, ratio) { return a * (1 - ratio) + b * ratio; }