import { MAdd } from "./madd.js" ; /**
 * Returns new  MAdd gen, producing an exponential curve (with
 * adjustable curvature) between `start` and `end` values over `num`
 * steps. This is the exponential equivalent of  line .
 *
 *  remarks Unless `skipFirst` is true (default: false), the `end` value is only
 * reached at `num + 1` steps. Unless `clampEnd` is true (default:
 * false), the curve will NOT stop at `end` but continue indefinitely if
 * more values are requested from the generator.
 *
 * The curvature can be controlled via the logarithmic `rate` param.
 * Recommended range [0.0001 - 10000] (curved -> linear). Default: 0.1
 *
 * Also see  madd .
 *
 *  example param start param end param num param rate param skipFirst param clampEnd export const curve = ( start , end , num , rate = 0.1 , skipFirst = false , clampEnd = false ) => { const c = Math . exp ( - Math . log ( ( Math . abs ( end - start ) + rate ) / rate ) / num ) ; const offset = ( start < end ? end + rate : end - rate ) * ( 1 - c ) ; return new MAdd ( c , skipFirst ? offset + start * c : start , offset , clampEnd ? end : undefined ) ; } ;