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

Function getXY

src/tailwind/Components/GooeyNav/GooeyNav.jsx:20–23  ·  view source on GitHub ↗
(distance, pointIndex, totalPoints)

Source from the content-addressed store, hash-verified

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)];
23 };
24 const createParticle = (i, t, d, r) => {
25 let rotate = noise(r / 10);
26 return {

Callers 1

createParticleFunction · 0.70

Calls 1

noiseFunction · 0.70

Tested by

no test coverage detected