@wemap/maths 10.0.0 → 10.3.0-alpha.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/index.d.ts +3 -2
- package/package.json +2 -2
- package/src/Matrix3.js +9 -3
package/index.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ declare module '@wemap/maths' {
|
|
|
90
90
|
export class Matrix {
|
|
91
91
|
static concatRow(m1: Matrix_t, m2: Matrix_t): Matrix_t;
|
|
92
92
|
static concatLine(m1: Matrix_t, m2: Matrix_t): Matrix_t;
|
|
93
|
-
static diag(
|
|
93
|
+
static diag(arr: Vector_t): Matrix_t;
|
|
94
94
|
static inverse(m: Matrix_t): Matrix_t;
|
|
95
95
|
static multiply(m1: Matrix_t, m2: Matrix_t): Matrix_t;
|
|
96
96
|
static multiplyScalar(m: Matrix_t, s: number): Matrix_t;
|
|
@@ -99,10 +99,11 @@ declare module '@wemap/maths' {
|
|
|
99
99
|
static transpose(m: Matrix_t): Matrix_t;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export class Matrix3
|
|
102
|
+
export class Matrix3 {
|
|
103
103
|
static get identity(): Matrix3_t;
|
|
104
104
|
static get zeros(): Matrix3_t;
|
|
105
105
|
|
|
106
|
+
static diag(arr: Vector3_t): Matrix3_t;
|
|
106
107
|
static inverse(q: Matrix3_t): Matrix3_t;
|
|
107
108
|
static multiply(a: Matrix3_t, b: Matrix3_t): Matrix3_t;
|
|
108
109
|
static multiplyScalar(m: Matrix3_t, s: number): Matrix3_t;
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"directory": "packages/maths"
|
|
14
14
|
},
|
|
15
15
|
"name": "@wemap/maths",
|
|
16
|
-
"version": "10.0.0",
|
|
16
|
+
"version": "10.3.0-alpha.0",
|
|
17
17
|
"bugs": {
|
|
18
18
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
19
19
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"wemap"
|
|
27
27
|
],
|
|
28
28
|
"license": "ISC",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d08f3459ff3cb996212da48efb454b1518c2f7fb"
|
|
30
30
|
}
|
package/src/Matrix3.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
class Matrix3 extends Matrix {
|
|
1
|
+
class Matrix3 {
|
|
4
2
|
|
|
5
3
|
static get identity() {
|
|
6
4
|
return [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
|
|
@@ -10,6 +8,14 @@ class Matrix3 extends Matrix {
|
|
|
10
8
|
return [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
|
|
11
9
|
}
|
|
12
10
|
|
|
11
|
+
static diag(arr) {
|
|
12
|
+
return [
|
|
13
|
+
[arr[0], 0, 0],
|
|
14
|
+
[0, arr[1], 0],
|
|
15
|
+
[0, 0, arr[2]]
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
static sum(m1, m2) {
|
|
14
20
|
return [
|
|
15
21
|
[m1[0][0] + m2[0][0], m1[0][1] + m2[0][1], m1[0][2] + m2[0][2]],
|