getRadian

说明

角度弧度

源码

用法

getRadian.test.ts
1
import { getRadian } from "../../utility/number/getRadian";
2
3
describe('getRadian', () => {
4
test('getRadian should receive an angle and convert it to radian', () => {
5
const origin = [
6
0,
7
78,
8
90,
9
180,
10
360
11
];
12
const expected = [
13
0,
14
1.361356816555577,
15
1.5707963267948966,
16
3.141592653589793,
17
6.283185307179586,
18
];
19
const result: number[] = [];
20
21
for (const v of origin) {
22
result.push(getRadian(v));
23
}
24
25
for (const [i, v] of result.entries()) {
26
expect(v === expected[i]).toBeTruthy();
27
}
28
});
29
});
Copied!
最近更新 1yr ago
复制链接