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

Function wrapAngleSigned

src/tailwind/Components/DomeGallery/DomeGallery.jsx:44–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42const clamp = (v, min, max) => Math.min(Math.max(v, min), max);
43const normalizeAngle = d => ((d % 360) + 360) % 360;
44const wrapAngleSigned = deg => {
45 const a = (((deg + 180) % 360) + 360) % 360;
46 return a - 180;
47};
48const getDataNumber = (el, name, fallback) => {
49 const attr = el.dataset[name] ?? el.getAttribute(`data-${name}`);
50 const n = attr == null ? NaN : parseFloat(attr);

Callers 1

stepFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected