| 13 | const circumference = TWO_PI * defaultRadius; |
| 14 | |
| 15 | function polarToCartesian( |
| 16 | centerX: number, |
| 17 | centerY: number, |
| 18 | radius: number, |
| 19 | angleInDegrees: number, |
| 20 | ): { x: number; y: number } { |
| 21 | const angleInRadians = (angleInDegrees - 90) / RAD_TO_DEGREES; |
| 22 | |
| 23 | return { |
| 24 | x: centerX + radius * Math.cos(angleInRadians), |
| 25 | y: centerY + radius * Math.sin(angleInRadians), |
| 26 | }; |
| 27 | } |
| 28 | |
| 29 | function describeArc(startAngle: number, endAngle: number): string { |
| 30 | const start = polarToCartesian(center, center, defaultRadius, endAngle); |