@lijuhong1981/jsmath 1.0.0 → 1.0.1
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
CHANGED
|
@@ -13,11 +13,7 @@ import {
|
|
|
13
13
|
RADIANS_PER_ARCSECOND
|
|
14
14
|
} from "./src/Constant.js";
|
|
15
15
|
import clampToRange from "./src/clampToRange.js";
|
|
16
|
-
import clampToLongitudeRange from "./src/clampToLongitudeRange.js";
|
|
17
|
-
import clampToLatitudeRange from "./src/clampToLatitudeRange.js";
|
|
18
16
|
import convertToRange from "./src/convertToRange.js";
|
|
19
|
-
import convertToLongitudeRange from "./src/convertToLongitudeRange.js";
|
|
20
|
-
import convertToLatitudeRange from "./src/convertToLatitudeRange.js";
|
|
21
17
|
import convertToDegreesRound from "./src/convertToDegreesRound.js";
|
|
22
18
|
import convertToRadiansRound from "./src/convertToRadiansRound.js";
|
|
23
19
|
import percentInRange from "./src/percentInRange.js";
|
|
@@ -39,11 +35,7 @@ export {
|
|
|
39
35
|
DEGREES_PER_RADIAN,
|
|
40
36
|
RADIANS_PER_ARCSECOND,
|
|
41
37
|
clampToRange,
|
|
42
|
-
clampToLongitudeRange,
|
|
43
|
-
clampToLatitudeRange,
|
|
44
38
|
convertToRange,
|
|
45
|
-
convertToLongitudeRange,
|
|
46
|
-
convertToLatitudeRange,
|
|
47
39
|
convertToDegreesRound,
|
|
48
40
|
convertToRadiansRound,
|
|
49
41
|
percentInRange,
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import clampToRange from "./clampToRange.js";
|
|
2
|
-
import { PI_OVER_TWO } from "./Constant.js";
|
|
3
|
-
|
|
4
|
-
function clampToLatitudeRange(latitude, degrees = true) {
|
|
5
|
-
if (degrees)
|
|
6
|
-
return clampToRange(latitude, -90, 90);
|
|
7
|
-
else
|
|
8
|
-
return clampToRange(latitude, -PI_OVER_TWO, PI_OVER_TWO);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default clampToLatitudeRange;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import clampToRange from "./clampToRange.js";
|
|
2
|
-
|
|
3
|
-
function clampToLongitudeRange(longitude, degrees = true) {
|
|
4
|
-
if (degrees)
|
|
5
|
-
return clampToRange(longitude, -180, 180);
|
|
6
|
-
else
|
|
7
|
-
return clampToRange(longitude, -Math.PI, Math.PI);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default clampToLongitudeRange;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PI_OVER_TWO } from "./Constant.js";
|
|
2
|
-
|
|
3
|
-
function convertToLatitudeRange(latitude, degrees = true) {
|
|
4
|
-
if (degrees) {
|
|
5
|
-
while (latitude > 90 || latitude < -90) {
|
|
6
|
-
if (latitude > 90) {
|
|
7
|
-
latitude = 180 - latitude;
|
|
8
|
-
} else if (latitude < -90) {
|
|
9
|
-
latitude = -180 - latitude;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
} else {
|
|
13
|
-
while (latitude > PI_OVER_TWO || latitude < -PI_OVER_TWO) {
|
|
14
|
-
if (latitude > PI_OVER_TWO) {
|
|
15
|
-
latitude = Math.PI - latitude;
|
|
16
|
-
} else if (latitude < -PI_OVER_TWO) {
|
|
17
|
-
latitude = -Math.PI - latitude;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return latitude;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default convertToLatitudeRange;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import convertToRange from "./convertToRange.js";
|
|
2
|
-
|
|
3
|
-
function convertToLongitudeRange(longitude, degrees = true) {
|
|
4
|
-
if (degrees)
|
|
5
|
-
return convertToRange(longitude, -180, 180);
|
|
6
|
-
else
|
|
7
|
-
return convertToRange(longitude, -Math.PI, Math.PI);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default convertToLongitudeRange;
|