MCPcopy Create free account
hub / github.com/codrops/OnScrollShapeMorph / map

Function map

js/utils.js:36–36  ·  view source on GitHub ↗
(x, a, b, c, d)

Source from the content-addressed store, hash-verified

34 * Map number x from range [a, b] to [c, d]
35 */
36const map = (x, a, b, c, d) => (x - a) * (d - c) / (b - a) + c;
37
38/**
39 * Calculates the viewport size

Callers 1

renderMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected