@lijuhong1981/jsmath 1.2.1 → 1.2.2
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/package.json +2 -2
- package/src/Constant.js +6 -0
- package/src/convertToRange.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijuhong1981/jsmath",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "lijuhong1981",
|
|
6
6
|
"homepage": "https://github.com/lijuhong1981/jslibs#readme",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/lijuhong1981/jslibs/issues"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "d20df0ba5bb330d43c7828f8a97b41ca3860a570"
|
|
22
22
|
}
|
package/src/Constant.js
CHANGED
|
@@ -9,6 +9,12 @@ const TWO_PI = 2.0 * PI;
|
|
|
9
9
|
const ONE_OVER_TWO_PI = 1.0 / (2.0 * PI);
|
|
10
10
|
const RADIANS_PER_DEGREE = PI / 180.0;
|
|
11
11
|
const DEGREES_PER_RADIAN = 180.0 / PI;
|
|
12
|
+
/**
|
|
13
|
+
* The number of radians in an arc second.
|
|
14
|
+
*
|
|
15
|
+
* @type {number}
|
|
16
|
+
* @constant
|
|
17
|
+
*/
|
|
12
18
|
const RADIANS_PER_ARCSECOND = RADIANS_PER_DEGREE / 3600.0;
|
|
13
19
|
|
|
14
20
|
/**
|
package/src/convertToRange.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 将一个数值转换至两个数值范围内
|
|
3
3
|
* 如不在范围内则累加或累减范围长度,直至落在范围内
|
|
4
|
-
* @param {Number} 需要转换的数值
|
|
5
|
-
* @param {Number} 较小数
|
|
6
|
-
* @param {Number} 较大数
|
|
4
|
+
* @param {Number} value 需要转换的数值
|
|
5
|
+
* @param {Number} rangeMinimum 较小数
|
|
6
|
+
* @param {Number} rangeMaximum 较大数
|
|
7
7
|
* @returns {Number} 转换后的数值
|
|
8
8
|
*/
|
|
9
9
|
function convertToRange(value, rangeMinimum, rangeMaximum) {
|