@math.gl/core 4.0.0 → 4.1.0-alpha.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.
Files changed (147) hide show
  1. package/dist/classes/base/math-array.d.ts +1 -2
  2. package/dist/classes/base/math-array.js +223 -266
  3. package/dist/classes/base/matrix.d.ts +1 -2
  4. package/dist/classes/base/matrix.js +56 -53
  5. package/dist/classes/base/vector.d.ts +1 -2
  6. package/dist/classes/base/vector.js +125 -135
  7. package/dist/classes/euler.d.ts +2 -3
  8. package/dist/classes/euler.js +464 -533
  9. package/dist/classes/matrix3.d.ts +9 -4
  10. package/dist/classes/matrix3.js +191 -190
  11. package/dist/classes/matrix4.d.ts +8 -4
  12. package/dist/classes/matrix4.js +521 -452
  13. package/dist/classes/pose.d.ts +4 -5
  14. package/dist/classes/pose.js +106 -119
  15. package/dist/classes/quaternion.d.ts +1 -2
  16. package/dist/classes/quaternion.js +261 -233
  17. package/dist/classes/spherical-coordinates.d.ts +3 -4
  18. package/dist/classes/spherical-coordinates.js +142 -147
  19. package/dist/classes/vector2.d.ts +6 -5
  20. package/dist/classes/vector2.js +103 -85
  21. package/dist/classes/vector3.d.ts +6 -5
  22. package/dist/classes/vector3.js +129 -136
  23. package/dist/classes/vector4.d.ts +7 -6
  24. package/dist/classes/vector4.js +108 -114
  25. package/dist/gl-matrix/common.d.ts +0 -1
  26. package/dist/gl-matrix/common.js +38 -6
  27. package/dist/gl-matrix/mat3.d.ts +0 -1
  28. package/dist/gl-matrix/mat3.js +699 -425
  29. package/dist/gl-matrix/mat4.d.ts +0 -1
  30. package/dist/gl-matrix/mat4.js +1879 -1339
  31. package/dist/gl-matrix/quat.d.ts +0 -1
  32. package/dist/gl-matrix/quat.js +655 -257
  33. package/dist/gl-matrix/vec2.d.ts +0 -1
  34. package/dist/gl-matrix/vec2.js +529 -212
  35. package/dist/gl-matrix/vec3.d.ts +0 -1
  36. package/dist/gl-matrix/vec3.js +703 -335
  37. package/dist/gl-matrix/vec4.d.ts +0 -1
  38. package/dist/gl-matrix/vec4.js +579 -293
  39. package/dist/gl-matrix/wip/index.d.ts +3 -4
  40. package/dist/gl-matrix/wip/index.js +5 -1
  41. package/dist/gl-matrix/wip/mat2.d.ts +1 -2
  42. package/dist/gl-matrix/wip/mat2.js +336 -157
  43. package/dist/gl-matrix/wip/mat2d.d.ts +0 -1
  44. package/dist/gl-matrix/wip/mat2d.js +380 -202
  45. package/dist/gl-matrix/wip/quat2.d.ts +0 -1
  46. package/dist/gl-matrix/wip/quat2.js +650 -409
  47. package/dist/index.cjs +60 -100
  48. package/dist/index.cjs.map +7 -0
  49. package/dist/index.d.ts +27 -23
  50. package/dist/index.js +25 -16
  51. package/dist/lib/assert.d.ts +0 -1
  52. package/dist/lib/assert.js +6 -4
  53. package/dist/lib/common.d.ts +2 -3
  54. package/dist/lib/common.js +165 -134
  55. package/dist/lib/gl-matrix-extras.d.ts +0 -1
  56. package/dist/lib/gl-matrix-extras.js +42 -36
  57. package/dist/lib/math-utils.d.ts +0 -1
  58. package/dist/lib/math-utils.js +5 -1
  59. package/dist/lib/validators.d.ts +0 -1
  60. package/dist/lib/validators.js +25 -25
  61. package/package.json +5 -6
  62. package/src/classes/base/math-array.ts +4 -1
  63. package/src/classes/base/matrix.ts +4 -1
  64. package/src/classes/base/vector.ts +4 -1
  65. package/src/classes/euler.ts +4 -1
  66. package/src/classes/matrix3.ts +12 -3
  67. package/src/classes/matrix4.ts +11 -3
  68. package/src/classes/pose.ts +4 -1
  69. package/src/classes/quaternion.ts +4 -1
  70. package/src/classes/spherical-coordinates.ts +4 -1
  71. package/src/classes/vector2.ts +11 -4
  72. package/src/classes/vector3.ts +10 -4
  73. package/src/classes/vector4.ts +9 -4
  74. package/src/gl-matrix/wip/index.js +4 -0
  75. package/src/gl-matrix/wip/mat2.js +4 -0
  76. package/src/gl-matrix/wip/mat2d.js +4 -0
  77. package/src/gl-matrix/wip/quat2.ts +4 -0
  78. package/src/index.ts +10 -2
  79. package/src/lib/assert.ts +4 -0
  80. package/src/lib/common.ts +3 -1
  81. package/src/lib/gl-matrix-extras.ts +4 -0
  82. package/src/lib/gl-matrix.d.ts +4 -0
  83. package/src/lib/math-utils.ts +4 -0
  84. package/src/lib/validators.ts +4 -19
  85. package/dist/classes/base/math-array.d.ts.map +0 -1
  86. package/dist/classes/base/math-array.js.map +0 -1
  87. package/dist/classes/base/matrix.d.ts.map +0 -1
  88. package/dist/classes/base/matrix.js.map +0 -1
  89. package/dist/classes/base/vector.d.ts.map +0 -1
  90. package/dist/classes/base/vector.js.map +0 -1
  91. package/dist/classes/euler.d.ts.map +0 -1
  92. package/dist/classes/euler.js.map +0 -1
  93. package/dist/classes/matrix3.d.ts.map +0 -1
  94. package/dist/classes/matrix3.js.map +0 -1
  95. package/dist/classes/matrix4.d.ts.map +0 -1
  96. package/dist/classes/matrix4.js.map +0 -1
  97. package/dist/classes/pose.d.ts.map +0 -1
  98. package/dist/classes/pose.js.map +0 -1
  99. package/dist/classes/quaternion.d.ts.map +0 -1
  100. package/dist/classes/quaternion.js.map +0 -1
  101. package/dist/classes/spherical-coordinates.d.ts.map +0 -1
  102. package/dist/classes/spherical-coordinates.js.map +0 -1
  103. package/dist/classes/vector2.d.ts.map +0 -1
  104. package/dist/classes/vector2.js.map +0 -1
  105. package/dist/classes/vector3.d.ts.map +0 -1
  106. package/dist/classes/vector3.js.map +0 -1
  107. package/dist/classes/vector4.d.ts.map +0 -1
  108. package/dist/classes/vector4.js.map +0 -1
  109. package/dist/gl-matrix/common.d.ts.map +0 -1
  110. package/dist/gl-matrix/common.js.map +0 -1
  111. package/dist/gl-matrix/mat3.d.ts.map +0 -1
  112. package/dist/gl-matrix/mat3.js.map +0 -1
  113. package/dist/gl-matrix/mat4.d.ts.map +0 -1
  114. package/dist/gl-matrix/mat4.js.map +0 -1
  115. package/dist/gl-matrix/quat.d.ts.map +0 -1
  116. package/dist/gl-matrix/quat.js.map +0 -1
  117. package/dist/gl-matrix/vec2.d.ts.map +0 -1
  118. package/dist/gl-matrix/vec2.js.map +0 -1
  119. package/dist/gl-matrix/vec3.d.ts.map +0 -1
  120. package/dist/gl-matrix/vec3.js.map +0 -1
  121. package/dist/gl-matrix/vec4.d.ts.map +0 -1
  122. package/dist/gl-matrix/vec4.js.map +0 -1
  123. package/dist/gl-matrix/wip/index.d.ts.map +0 -1
  124. package/dist/gl-matrix/wip/index.js.map +0 -1
  125. package/dist/gl-matrix/wip/mat2.d.ts.map +0 -1
  126. package/dist/gl-matrix/wip/mat2.js.map +0 -1
  127. package/dist/gl-matrix/wip/mat2d.d.ts.map +0 -1
  128. package/dist/gl-matrix/wip/mat2d.js.map +0 -1
  129. package/dist/gl-matrix/wip/quat2.d.ts.map +0 -1
  130. package/dist/gl-matrix/wip/quat2.js.map +0 -1
  131. package/dist/gl-matrix/wip/types.d.js +0 -2
  132. package/dist/gl-matrix/wip/types.d.js.map +0 -1
  133. package/dist/index.d.ts.map +0 -1
  134. package/dist/index.js.map +0 -1
  135. package/dist/lib/assert.d.ts.map +0 -1
  136. package/dist/lib/assert.js.map +0 -1
  137. package/dist/lib/common.d.ts.map +0 -1
  138. package/dist/lib/common.js.map +0 -1
  139. package/dist/lib/gl-matrix-extras.d.ts.map +0 -1
  140. package/dist/lib/gl-matrix-extras.js.map +0 -1
  141. package/dist/lib/gl-matrix.d.js +0 -2
  142. package/dist/lib/gl-matrix.d.js.map +0 -1
  143. package/dist/lib/math-utils.d.ts.map +0 -1
  144. package/dist/lib/math-utils.js.map +0 -1
  145. package/dist/lib/validators.d.ts.map +0 -1
  146. package/dist/lib/validators.js.map +0 -1
  147. package/src/gl-matrix/wip/types.d.ts +0 -93
@@ -1,5 +1,5 @@
1
- import { NumericArray } from '@math.gl/types';
2
- import { Matrix } from './base/matrix';
1
+ import { NumericArray, NumberArray9 } from '@math.gl/types';
2
+ import { Matrix } from "./base/matrix.js";
3
3
  declare enum INDICES {
4
4
  COL0ROW0 = 0,
5
5
  COL0ROW1 = 1,
@@ -11,6 +11,12 @@ declare enum INDICES {
11
11
  COL2ROW1 = 7,
12
12
  COL2ROW2 = 8
13
13
  }
14
+ /** Helper type that captures array length for a 3x3 matrix */
15
+ export type Matrix3Like = Matrix3 | NumberArray9;
16
+ /**
17
+ * A 3x3 matrix with common linear algebra operations
18
+ * Subclass of Array<number> meaning that it is highly compatible with other libraries
19
+ */
14
20
  export declare class Matrix3 extends Matrix {
15
21
  static get IDENTITY(): Readonly<Matrix3>;
16
22
  static get ZERO(): Readonly<Matrix3>;
@@ -48,7 +54,7 @@ export declare class Matrix3 extends Matrix {
48
54
  invert(): this;
49
55
  multiplyLeft(a: NumericArray): this;
50
56
  multiplyRight(a: NumericArray): this;
51
- rotate(radians: number): NumericArray;
57
+ rotate(radians: number): this;
52
58
  scale(factor: NumericArray | number): this;
53
59
  translate(vec: NumericArray): this;
54
60
  transform(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray;
@@ -60,4 +66,3 @@ export declare class Matrix3 extends Matrix {
60
66
  transformVector3(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray;
61
67
  }
62
68
  export {};
63
- //# sourceMappingURL=matrix3.d.ts.map
@@ -1,3 +1,7 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Copyright (c) 2017 Uber Technologies, Inc.
1
5
  import { Matrix } from "./base/matrix.js";
2
6
  import { checkVector } from "../lib/validators.js";
3
7
  import { vec4_transformMat3 } from "../lib/gl-matrix-extras.js";
@@ -5,204 +9,201 @@ import { fromQuat as mat3_fromQuat, determinant as mat3_determinant, transpose a
5
9
  import { transformMat3 as vec2_transformMat3 } from "../gl-matrix/vec2.js";
6
10
  import { transformMat3 as vec3_transformMat3 } from "../gl-matrix/vec3.js";
7
11
  var INDICES;
8
-
9
12
  (function (INDICES) {
10
- INDICES[INDICES["COL0ROW0"] = 0] = "COL0ROW0";
11
- INDICES[INDICES["COL0ROW1"] = 1] = "COL0ROW1";
12
- INDICES[INDICES["COL0ROW2"] = 2] = "COL0ROW2";
13
- INDICES[INDICES["COL1ROW0"] = 3] = "COL1ROW0";
14
- INDICES[INDICES["COL1ROW1"] = 4] = "COL1ROW1";
15
- INDICES[INDICES["COL1ROW2"] = 5] = "COL1ROW2";
16
- INDICES[INDICES["COL2ROW0"] = 6] = "COL2ROW0";
17
- INDICES[INDICES["COL2ROW1"] = 7] = "COL2ROW1";
18
- INDICES[INDICES["COL2ROW2"] = 8] = "COL2ROW2";
13
+ INDICES[INDICES["COL0ROW0"] = 0] = "COL0ROW0";
14
+ INDICES[INDICES["COL0ROW1"] = 1] = "COL0ROW1";
15
+ INDICES[INDICES["COL0ROW2"] = 2] = "COL0ROW2";
16
+ INDICES[INDICES["COL1ROW0"] = 3] = "COL1ROW0";
17
+ INDICES[INDICES["COL1ROW1"] = 4] = "COL1ROW1";
18
+ INDICES[INDICES["COL1ROW2"] = 5] = "COL1ROW2";
19
+ INDICES[INDICES["COL2ROW0"] = 6] = "COL2ROW0";
20
+ INDICES[INDICES["COL2ROW1"] = 7] = "COL2ROW1";
21
+ INDICES[INDICES["COL2ROW2"] = 8] = "COL2ROW2";
19
22
  })(INDICES || (INDICES = {}));
20
-
21
23
  const IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
24
+ /**
25
+ * A 3x3 matrix with common linear algebra operations
26
+ * Subclass of Array<number> meaning that it is highly compatible with other libraries
27
+ */
22
28
  export class Matrix3 extends Matrix {
23
- static get IDENTITY() {
24
- return getIdentityMatrix();
25
- }
26
-
27
- static get ZERO() {
28
- return getZeroMatrix();
29
- }
30
-
31
- get ELEMENTS() {
32
- return 9;
33
- }
34
-
35
- get RANK() {
36
- return 3;
37
- }
38
-
39
- get INDICES() {
40
- return INDICES;
41
- }
42
-
43
- constructor(array, ...args) {
44
- super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
45
-
46
- if (arguments.length === 1 && Array.isArray(array)) {
47
- this.copy(array);
48
- } else if (args.length > 0) {
49
- this.copy([array, ...args]);
50
- } else {
51
- this.identity();
52
- }
53
- }
54
-
55
- copy(array) {
56
- this[0] = array[0];
57
- this[1] = array[1];
58
- this[2] = array[2];
59
- this[3] = array[3];
60
- this[4] = array[4];
61
- this[5] = array[5];
62
- this[6] = array[6];
63
- this[7] = array[7];
64
- this[8] = array[8];
65
- return this.check();
66
- }
67
-
68
- identity() {
69
- return this.copy(IDENTITY_MATRIX);
70
- }
71
-
72
- fromObject(object) {
73
- return this.check();
74
- }
75
-
76
- fromQuaternion(q) {
77
- mat3_fromQuat(this, q);
78
- return this.check();
79
- }
80
-
81
- set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
82
- this[0] = m00;
83
- this[1] = m10;
84
- this[2] = m20;
85
- this[3] = m01;
86
- this[4] = m11;
87
- this[5] = m21;
88
- this[6] = m02;
89
- this[7] = m12;
90
- this[8] = m22;
91
- return this.check();
92
- }
93
-
94
- setRowMajor(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
95
- this[0] = m00;
96
- this[1] = m10;
97
- this[2] = m20;
98
- this[3] = m01;
99
- this[4] = m11;
100
- this[5] = m21;
101
- this[6] = m02;
102
- this[7] = m12;
103
- this[8] = m22;
104
- return this.check();
105
- }
106
-
107
- determinant() {
108
- return mat3_determinant(this);
109
- }
110
-
111
- transpose() {
112
- mat3_transpose(this, this);
113
- return this.check();
114
- }
115
-
116
- invert() {
117
- mat3_invert(this, this);
118
- return this.check();
119
- }
120
-
121
- multiplyLeft(a) {
122
- mat3_multiply(this, a, this);
123
- return this.check();
124
- }
125
-
126
- multiplyRight(a) {
127
- mat3_multiply(this, this, a);
128
- return this.check();
129
- }
130
-
131
- rotate(radians) {
132
- mat3_rotate(this, this, radians);
133
- return this.check();
134
- }
135
-
136
- scale(factor) {
137
- if (Array.isArray(factor)) {
138
- mat3_scale(this, this, factor);
139
- } else {
140
- mat3_scale(this, this, [factor, factor]);
141
- }
142
-
143
- return this.check();
144
- }
145
-
146
- translate(vec) {
147
- mat3_translate(this, this, vec);
148
- return this.check();
149
- }
150
-
151
- transform(vector, result) {
152
- let out;
153
-
154
- switch (vector.length) {
155
- case 2:
156
- out = vec2_transformMat3(result || [-0, -0], vector, this);
157
- break;
158
-
159
- case 3:
160
- out = vec3_transformMat3(result || [-0, -0, -0], vector, this);
161
- break;
162
-
163
- case 4:
164
- out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
165
- break;
166
-
167
- default:
168
- throw new Error('Illegal vector');
169
- }
170
-
171
- checkVector(out, vector.length);
172
- return out;
173
- }
174
-
175
- transformVector(vector, result) {
176
- return this.transform(vector, result);
177
- }
178
-
179
- transformVector2(vector, result) {
180
- return this.transform(vector, result);
181
- }
182
-
183
- transformVector3(vector, result) {
184
- return this.transform(vector, result);
185
- }
186
-
29
+ static get IDENTITY() {
30
+ return getIdentityMatrix();
31
+ }
32
+ static get ZERO() {
33
+ return getZeroMatrix();
34
+ }
35
+ get ELEMENTS() {
36
+ return 9;
37
+ }
38
+ get RANK() {
39
+ return 3;
40
+ }
41
+ get INDICES() {
42
+ return INDICES;
43
+ }
44
+ constructor(array, ...args) {
45
+ // PERF NOTE: initialize elements as double precision numbers
46
+ super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
47
+ if (arguments.length === 1 && Array.isArray(array)) {
48
+ this.copy(array);
49
+ }
50
+ else if (args.length > 0) {
51
+ this.copy([array, ...args]);
52
+ }
53
+ else {
54
+ this.identity();
55
+ }
56
+ }
57
+ copy(array) {
58
+ // Element wise copy for performance
59
+ this[0] = array[0];
60
+ this[1] = array[1];
61
+ this[2] = array[2];
62
+ this[3] = array[3];
63
+ this[4] = array[4];
64
+ this[5] = array[5];
65
+ this[6] = array[6];
66
+ this[7] = array[7];
67
+ this[8] = array[8];
68
+ return this.check();
69
+ }
70
+ // Constructors
71
+ identity() {
72
+ return this.copy(IDENTITY_MATRIX);
73
+ }
74
+ /**
75
+ *
76
+ * @param object
77
+ * @returns self
78
+ */
79
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
80
+ fromObject(object) {
81
+ return this.check();
82
+ }
83
+ /** Calculates a 3x3 matrix from the given quaternion
84
+ * q quat Quaternion to create matrix from
85
+ */
86
+ fromQuaternion(q) {
87
+ mat3_fromQuat(this, q);
88
+ return this.check();
89
+ }
90
+ /**
91
+ * accepts column major order, stores in column major order
92
+ */
93
+ // eslint-disable-next-line max-params
94
+ set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
95
+ this[0] = m00;
96
+ this[1] = m10;
97
+ this[2] = m20;
98
+ this[3] = m01;
99
+ this[4] = m11;
100
+ this[5] = m21;
101
+ this[6] = m02;
102
+ this[7] = m12;
103
+ this[8] = m22;
104
+ return this.check();
105
+ }
106
+ /**
107
+ * accepts row major order, stores as column major
108
+ */
109
+ // eslint-disable-next-line max-params
110
+ setRowMajor(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
111
+ this[0] = m00;
112
+ this[1] = m10;
113
+ this[2] = m20;
114
+ this[3] = m01;
115
+ this[4] = m11;
116
+ this[5] = m21;
117
+ this[6] = m02;
118
+ this[7] = m12;
119
+ this[8] = m22;
120
+ return this.check();
121
+ }
122
+ // Accessors
123
+ determinant() {
124
+ return mat3_determinant(this);
125
+ }
126
+ // Modifiers
127
+ transpose() {
128
+ mat3_transpose(this, this);
129
+ return this.check();
130
+ }
131
+ /** Invert a matrix. Note that this can fail if the matrix is not invertible */
132
+ invert() {
133
+ mat3_invert(this, this);
134
+ return this.check();
135
+ }
136
+ // Operations
137
+ multiplyLeft(a) {
138
+ mat3_multiply(this, a, this);
139
+ return this.check();
140
+ }
141
+ multiplyRight(a) {
142
+ mat3_multiply(this, this, a);
143
+ return this.check();
144
+ }
145
+ rotate(radians) {
146
+ mat3_rotate(this, this, radians);
147
+ return this.check();
148
+ }
149
+ scale(factor) {
150
+ if (Array.isArray(factor)) {
151
+ mat3_scale(this, this, factor);
152
+ }
153
+ else {
154
+ mat3_scale(this, this, [factor, factor]);
155
+ }
156
+ return this.check();
157
+ }
158
+ translate(vec) {
159
+ mat3_translate(this, this, vec);
160
+ return this.check();
161
+ }
162
+ // Transforms
163
+ transform(vector, result) {
164
+ let out;
165
+ switch (vector.length) {
166
+ case 2:
167
+ out = vec2_transformMat3(result || [-0, -0], vector, this);
168
+ break;
169
+ case 3:
170
+ out = vec3_transformMat3(result || [-0, -0, -0], vector, this);
171
+ break;
172
+ case 4:
173
+ out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
174
+ break;
175
+ default:
176
+ throw new Error('Illegal vector');
177
+ }
178
+ checkVector(out, vector.length);
179
+ return out;
180
+ }
181
+ /** @deprecated */
182
+ transformVector(vector, result) {
183
+ return this.transform(vector, result);
184
+ }
185
+ /** @deprecated */
186
+ transformVector2(vector, result) {
187
+ return this.transform(vector, result);
188
+ }
189
+ /** @deprecated */
190
+ transformVector3(vector, result) {
191
+ return this.transform(vector, result);
192
+ }
187
193
  }
188
194
  let ZERO_MATRIX3;
189
195
  let IDENTITY_MATRIX3 = null;
190
-
191
196
  function getZeroMatrix() {
192
- if (!ZERO_MATRIX3) {
193
- ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
194
- Object.freeze(ZERO_MATRIX3);
195
- }
196
-
197
- return ZERO_MATRIX3;
197
+ if (!ZERO_MATRIX3) {
198
+ ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
199
+ Object.freeze(ZERO_MATRIX3);
200
+ }
201
+ return ZERO_MATRIX3;
198
202
  }
199
-
200
203
  function getIdentityMatrix() {
201
- if (!IDENTITY_MATRIX3) {
202
- IDENTITY_MATRIX3 = new Matrix3();
203
- Object.freeze(IDENTITY_MATRIX3);
204
- }
205
-
206
- return IDENTITY_MATRIX3;
204
+ if (!IDENTITY_MATRIX3) {
205
+ IDENTITY_MATRIX3 = new Matrix3();
206
+ Object.freeze(IDENTITY_MATRIX3);
207
+ }
208
+ return IDENTITY_MATRIX3;
207
209
  }
208
- //# sourceMappingURL=matrix3.js.map
@@ -1,5 +1,5 @@
1
- import { NumericArray } from '@math.gl/types';
2
- import { Matrix } from './base/matrix';
1
+ import { NumericArray, NumberArray16 } from '@math.gl/types';
2
+ import { Matrix } from "./base/matrix.js";
3
3
  declare enum INDICES {
4
4
  COL0ROW0 = 0,
5
5
  COL0ROW1 = 1,
@@ -18,7 +18,12 @@ declare enum INDICES {
18
18
  COL3ROW2 = 14,
19
19
  COL3ROW3 = 15
20
20
  }
21
- /** 4x4 matrix */
21
+ /** Helper type that captures array length for a 4x4 matrix */
22
+ export type Matrix4Like = Matrix4 | NumberArray16;
23
+ /**
24
+ * A 4x4 matrix with common linear algebra operations
25
+ * Subclass of Array<number> meaning that it is highly compatible with other libraries
26
+ */
22
27
  export declare class Matrix4 extends Matrix {
23
28
  static get IDENTITY(): Readonly<Matrix4>;
24
29
  static get ZERO(): Readonly<Matrix4>;
@@ -223,4 +228,3 @@ export declare class Matrix4 extends Matrix {
223
228
  makeTranslation(x: number, y: number, z: number): this;
224
229
  }
225
230
  export {};
226
- //# sourceMappingURL=matrix4.d.ts.map