MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / arcPath

Function arcPath

src/components/SentimentPanel.tsx:40–47  ·  view source on GitHub ↗
(from: number, to: number)

Source from the content-addressed store, hash-verified

38 ];
39
40 const arcPath = (from: number, to: number) => {
41 const a1 = valToAngle(from);
42 const a2 = valToAngle(to);
43 const p1 = polar(a1, r);
44 const p2 = polar(a2, r);
45 const large = Math.abs(a1 - a2) > Math.PI ? 1 : 0;
46 return `M ${p1.x} ${p1.y} A ${r} ${r} 0 ${large} 1 ${p2.x} ${p2.y}`;
47 };
48
49 // Needle
50 const needleAngle = valToAngle(Math.max(0, Math.min(100, score)));

Callers 1

GaugeFunction · 0.85

Calls 2

valToAngleFunction · 0.85
polarFunction · 0.85

Tested by

no test coverage detected