@lijuhong1981/jsmath 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -0
- package/package.json +2 -2
- package/src/degToRad.js +14 -0
- package/src/radToDeg.js +14 -0
package/index.js
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
DEGREES_PER_RADIAN,
|
|
13
13
|
RADIANS_PER_ARCSECOND
|
|
14
14
|
} from "./src/Constant.js";
|
|
15
|
+
import degToRad from "./src/degToRad.js";
|
|
16
|
+
import radToDeg from "./src/radToDeg.js";
|
|
15
17
|
import clamp from "./src/clamp.js";
|
|
16
18
|
import clampLatitude from "./src/clampLatitude.js";
|
|
17
19
|
import clampLongitude from "./src/clampLongitude.js";
|
|
@@ -41,6 +43,8 @@ export {
|
|
|
41
43
|
RADIANS_PER_DEGREE,
|
|
42
44
|
DEGREES_PER_RADIAN,
|
|
43
45
|
RADIANS_PER_ARCSECOND,
|
|
46
|
+
degToRad,
|
|
47
|
+
radToDeg,
|
|
44
48
|
clamp,
|
|
45
49
|
clampLatitude,
|
|
46
50
|
clampLongitude,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijuhong1981/jsmath",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/lijuhong1981/jsmath#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@lijuhong1981/jscheck": "^1.0.
|
|
22
|
+
"@lijuhong1981/jscheck": "^1.0.2"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/src/degToRad.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Check from "@lijuhong1981/jscheck";
|
|
2
|
+
import { RADIANS_PER_DEGREE } from "./Constant.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 角度转弧度
|
|
6
|
+
* @param {Number} degrees 角度
|
|
7
|
+
* @returns {Number} 弧度
|
|
8
|
+
*/
|
|
9
|
+
function degToRad(degrees) {
|
|
10
|
+
Check.typeOf.number('degrees', degrees);
|
|
11
|
+
return degrees * RADIANS_PER_DEGREE;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default degToRad;
|
package/src/radToDeg.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Check from "@lijuhong1981/jscheck";
|
|
2
|
+
import { DEGREES_PER_RADIAN } from "./Constant";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 弧度转角度
|
|
6
|
+
* @param {Number} radians 弧度
|
|
7
|
+
* @returns {Number} 角度
|
|
8
|
+
*/
|
|
9
|
+
function radToDeg(radians) {
|
|
10
|
+
Check.typeOf.number('radians', radians);
|
|
11
|
+
return radians * DEGREES_PER_RADIAN;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default radToDeg;
|