@wemap/maths 0.1.2 → 0.2.0
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/Rotations.js +0 -7
- package/src/Utils.js +9 -4
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/maths"
|
|
13
13
|
},
|
|
14
14
|
"name": "@wemap/maths",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.2.0",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/wemap/wemap-utils-js/issues"
|
|
18
18
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"wemap"
|
|
27
27
|
],
|
|
28
28
|
"license": "ISC",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "6673bc4d0f4b6ff404534e0642122c340fe58483"
|
|
30
30
|
}
|
package/src/Rotations.js
CHANGED
|
@@ -131,13 +131,6 @@ class Rotations {
|
|
|
131
131
|
return Quaternion.normalize(quat);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
// TODO: Should be moved in wemap-positioning
|
|
135
|
-
// // Linear acceleration in ENU
|
|
136
|
-
// static computeLinearAcceleration(quaternion, acc) {
|
|
137
|
-
// const linearAcc = Quaternion.rotate(Quaternion.inverse(quaternion), acc);
|
|
138
|
-
// linearAcc[2] -= Constants.EARTH_GRAVITY;
|
|
139
|
-
// return linearAcc;
|
|
140
|
-
// }
|
|
141
134
|
}
|
|
142
135
|
|
|
143
136
|
export default Rotations;
|
package/src/Utils.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* [MathUtils description]
|
|
3
|
-
* @type {Object}
|
|
4
|
-
*/
|
|
1
|
+
|
|
5
2
|
class Utils {
|
|
6
3
|
|
|
7
4
|
/**
|
|
@@ -17,10 +14,18 @@ class Utils {
|
|
|
17
14
|
return rad * 180 / Math.PI;
|
|
18
15
|
}
|
|
19
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Difference between two angles
|
|
19
|
+
* @param {Number} angle1 in radians
|
|
20
|
+
* @param {Number} angle2 in radians
|
|
21
|
+
*/
|
|
20
22
|
static diffAngle(angle1, angle2) {
|
|
21
23
|
return (angle1 - angle2 + Math.PI) % (2 * Math.PI) - Math.PI;
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
static positiveMod(n, m) {
|
|
27
|
+
return ((n % m) + m) % m;
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export default Utils;
|