sinusoidal-decimal
This is a lightweight way to apply a sine curve to numbers in a numeric range.
It is similar to easing, but intended for cases where you have a numeric start point, end point, and position(s) relative to these points.
const sinusoidal = // Usage: sinusoidal(value, min, max, returnDecimal) // 10 // 10 // 15.8578... // 30 // 44.1421... // 50 // 50 // If returnDecimal flag is true, returns decimal position on sine curve // 0 // 0 // 0.1464... // 0.5 // 0.8535... // 1 // 1
License
MIT