1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.convertAngles = exports.toDegree = exports.toRadian = void 0;
|
4 | function toRadian(degree) {
|
5 | return (degree * Math.PI) / 180;
|
6 | }
|
7 | exports.toRadian = toRadian;
|
8 | function toDegree(radian) {
|
9 | return (radian * 180) / Math.PI;
|
10 | }
|
11 | exports.toDegree = toDegree;
|
12 |
|
13 | function convertAngles(startAngle, endAngle) {
|
14 | startAngle = startAngle % (2 * Math.PI);
|
15 | endAngle = endAngle % (2 * Math.PI);
|
16 | if (startAngle < 0) {
|
17 | startAngle = 2 * Math.PI + startAngle;
|
18 | }
|
19 | if (endAngle < 0) {
|
20 | endAngle = 2 * Math.PI + endAngle;
|
21 | }
|
22 | if (startAngle >= endAngle) {
|
23 | endAngle = endAngle + 2 * Math.PI;
|
24 | }
|
25 | return {
|
26 | startAngle,
|
27 | endAngle,
|
28 | };
|
29 | }
|
30 | exports.convertAngles = convertAngles;
|
31 |
|
\ | No newline at end of file |