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

Function noise

src/tailwind/Components/GooeyNav/GooeyNav.jsx:19–19  ·  view source on GitHub ↗
(n = 1)

Source from the content-addressed store, hash-verified

17 const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
18
19 const noise = (n = 1) => n / 2 - Math.random() * n;
20 const getXY = (distance, pointIndex, totalPoints) => {
21 const angle = ((360 + noise(8)) / totalPoints) * pointIndex * (Math.PI / 180);
22 return [distance * Math.cos(angle), distance * Math.sin(angle)];

Callers 3

getXYFunction · 0.70
createParticleFunction · 0.70
makeParticlesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected