MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / map

Function map

src/content/Components/DecayCard/DecayCard.jsx:26–26  ·  view source on GitHub ↗
(x, a, b, c, d)

Source from the content-addressed store, hash-verified

24 const lerp = (a, b, n) => (1 - n) * a + n * b;
25
26 const map = (x, a, b, c, d) => ((x - a) * (d - c)) / (b - a) + c;
27
28 const distance = (x1, x2, y1, y2) => {
29 const a = x1 - x2;

Callers 1

renderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected