@thi.ng/matrices 1.0.4 → 2.0.3

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 (118) hide show
  1. package/CHANGELOG.md +68 -97
  2. package/README.md +26 -16
  3. package/add.d.ts +1 -1
  4. package/add.js +2 -2
  5. package/addn.d.ts +1 -1
  6. package/addn.js +2 -2
  7. package/alignment-quat.d.ts +1 -1
  8. package/alignment-quat.js +5 -2
  9. package/column.d.ts +1 -1
  10. package/column.js +2 -1
  11. package/compile/emit.d.ts +4 -0
  12. package/{internal/codegen.js → compile/emit.js} +2 -1
  13. package/concat.d.ts +1 -1
  14. package/concat.js +1 -1
  15. package/conjugate.d.ts +1 -1
  16. package/conjugate.js +1 -1
  17. package/constants.d.ts +1 -1
  18. package/determinant.d.ts +1 -1
  19. package/determinant.js +1 -1
  20. package/diag.d.ts +5 -5
  21. package/diag.js +2 -1
  22. package/div.d.ts +1 -1
  23. package/div.js +2 -2
  24. package/divn.d.ts +1 -1
  25. package/divn.js +2 -2
  26. package/frustum.d.ts +1 -1
  27. package/frustum.js +2 -2
  28. package/identity.d.ts +5 -5
  29. package/identity.js +3 -3
  30. package/index.d.ts +56 -56
  31. package/index.js +56 -56
  32. package/invert.d.ts +2 -2
  33. package/invert.js +5 -2
  34. package/lookat.d.ts +2 -2
  35. package/lookat.js +5 -1
  36. package/m22-m23.d.ts +1 -1
  37. package/m22-m23.js +1 -1
  38. package/m23-m22.d.ts +1 -1
  39. package/m23-m22.js +1 -1
  40. package/m23-m44.d.ts +1 -1
  41. package/m23-m44.js +1 -1
  42. package/m33-m44.d.ts +1 -1
  43. package/m33-m44.js +1 -1
  44. package/m44-m33.d.ts +1 -1
  45. package/m44-m33.js +1 -1
  46. package/matn.d.ts +1 -1
  47. package/matn.js +1 -1
  48. package/matv.js +1 -1
  49. package/mixq.d.ts +2 -2
  50. package/mixq.js +4 -1
  51. package/mul.d.ts +1 -1
  52. package/mul.js +2 -2
  53. package/mulm.d.ts +5 -5
  54. package/mulm.js +3 -1
  55. package/muln.d.ts +1 -1
  56. package/muln.js +2 -2
  57. package/mulq.d.ts +1 -1
  58. package/mulq.js +1 -1
  59. package/mulv.d.ts +2 -2
  60. package/mulv.js +3 -1
  61. package/mulvm.d.ts +2 -2
  62. package/mulvm.js +3 -1
  63. package/normal-mat.d.ts +1 -1
  64. package/normal-mat.js +3 -3
  65. package/orthagonal.d.ts +1 -1
  66. package/orthagonal.js +2 -1
  67. package/ortho.d.ts +1 -1
  68. package/ortho.js +1 -1
  69. package/outer-product.d.ts +1 -1
  70. package/outer-product.js +2 -1
  71. package/package.json +199 -26
  72. package/perspective.d.ts +1 -1
  73. package/perspective.js +1 -1
  74. package/project.d.ts +2 -2
  75. package/project.js +3 -3
  76. package/quat-axis-angle.d.ts +1 -1
  77. package/quat-axis-angle.js +2 -2
  78. package/quat-euler.d.ts +7 -7
  79. package/quat-euler.js +3 -3
  80. package/quat-m33.d.ts +1 -1
  81. package/quat-m33.js +1 -1
  82. package/quat-m44.d.ts +3 -3
  83. package/quat-m44.js +2 -1
  84. package/rotation-around-axis.d.ts +2 -2
  85. package/rotation-around-axis.js +4 -3
  86. package/rotation.d.ts +1 -1
  87. package/rotation.js +2 -2
  88. package/row.d.ts +5 -5
  89. package/row.js +2 -1
  90. package/scale-center.d.ts +2 -2
  91. package/scale-center.js +4 -4
  92. package/scale.d.ts +1 -1
  93. package/scale.js +2 -2
  94. package/set.d.ts +1 -1
  95. package/set.js +3 -1
  96. package/shear.d.ts +1 -1
  97. package/shear.js +1 -1
  98. package/skew.d.ts +1 -1
  99. package/skew.js +1 -1
  100. package/sub.d.ts +1 -1
  101. package/sub.js +2 -2
  102. package/subn.d.ts +1 -1
  103. package/subn.js +2 -2
  104. package/trace.d.ts +1 -1
  105. package/trace.js +2 -2
  106. package/transform.d.ts +1 -1
  107. package/transform.js +7 -7
  108. package/translation.d.ts +2 -2
  109. package/translation.js +1 -1
  110. package/transpose.d.ts +1 -1
  111. package/transpose.js +1 -1
  112. package/viewport.d.ts +1 -1
  113. package/viewport.js +3 -3
  114. package/internal/codegen.d.ts +0 -4
  115. package/lib/index.js +0 -733
  116. package/lib/index.js.map +0 -1
  117. package/lib/index.umd.js +0 -1
  118. package/lib/index.umd.js.map +0 -1
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thi.ng/matrices",
3
- "version": "1.0.4",
3
+ "version": "2.0.3",
4
4
  "description": "Matrix & quaternion operations for 2D/3D geometry processing",
5
+ "type": "module",
5
6
  "module": "./index.js",
6
- "main": "./lib/index.js",
7
- "umd:main": "./lib/index.umd.js",
8
7
  "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
@@ -24,31 +24,24 @@
24
24
  "author": "Karsten Schmidt <k+npm@thi.ng>",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
- "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
28
- "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
29
- "build:es6": "tsc --declaration",
30
- "build:test": "rimraf build && tsc -p test/tsconfig.json",
31
- "build:check": "tsc --isolatedModules --noEmit",
32
- "test": "mocha test",
33
- "cover": "nyc mocha test && nyc report --reporter=lcov",
34
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib internal",
35
- "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
36
- "doc": "typedoc --excludePrivate --out doc --theme ../../tools/doc/typedoc-theme src/index.ts",
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf *.js *.d.ts *.map doc compile",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
37
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
38
- "pub": "yarn build:release && yarn publish --access public"
31
+ "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
+ "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
+ "pub": "yarn build && yarn publish --access public",
34
+ "test": "testament test"
39
35
  },
40
36
  "dependencies": {
41
- "@thi.ng/api": "^7.1.9",
42
- "@thi.ng/checks": "^2.9.10",
43
- "@thi.ng/math": "^4.0.5",
44
- "@thi.ng/vectors": "^6.1.2"
37
+ "@thi.ng/api": "^8.0.3",
38
+ "@thi.ng/checks": "^3.0.3",
39
+ "@thi.ng/math": "^5.0.3",
40
+ "@thi.ng/vectors": "^7.0.3"
41
+ },
42
+ "devDependencies": {
43
+ "@thi.ng/testament": "^0.1.3"
45
44
  },
46
- "files": [
47
- "*.js",
48
- "*.d.ts",
49
- "lib",
50
- "internal"
51
- ],
52
45
  "keywords": [
53
46
  "2d",
54
47
  "3d",
@@ -81,7 +74,187 @@
81
74
  "process": false,
82
75
  "setTimeout": false
83
76
  },
84
- "sideEffects": false,
77
+ "engines": {
78
+ "node": ">=12.7"
79
+ },
80
+ "files": [
81
+ "*.js",
82
+ "*.d.ts",
83
+ "compile"
84
+ ],
85
+ "exports": {
86
+ ".": {
87
+ "import": "./index.js"
88
+ },
89
+ "./add": {
90
+ "import": "./add.js"
91
+ },
92
+ "./addn": {
93
+ "import": "./addn.js"
94
+ },
95
+ "./alignment-quat": {
96
+ "import": "./alignment-quat.js"
97
+ },
98
+ "./api": {
99
+ "import": "./api.js"
100
+ },
101
+ "./column": {
102
+ "import": "./column.js"
103
+ },
104
+ "./compile/emit": {
105
+ "import": "./compile/emit.js"
106
+ },
107
+ "./concat": {
108
+ "import": "./concat.js"
109
+ },
110
+ "./conjugate": {
111
+ "import": "./conjugate.js"
112
+ },
113
+ "./constants": {
114
+ "import": "./constants.js"
115
+ },
116
+ "./determinant": {
117
+ "import": "./determinant.js"
118
+ },
119
+ "./diag": {
120
+ "import": "./diag.js"
121
+ },
122
+ "./div": {
123
+ "import": "./div.js"
124
+ },
125
+ "./divn": {
126
+ "import": "./divn.js"
127
+ },
128
+ "./frustum": {
129
+ "import": "./frustum.js"
130
+ },
131
+ "./identity": {
132
+ "import": "./identity.js"
133
+ },
134
+ "./invert": {
135
+ "import": "./invert.js"
136
+ },
137
+ "./lookat": {
138
+ "import": "./lookat.js"
139
+ },
140
+ "./m22-m23": {
141
+ "import": "./m22-m23.js"
142
+ },
143
+ "./m23-m22": {
144
+ "import": "./m23-m22.js"
145
+ },
146
+ "./m23-m44": {
147
+ "import": "./m23-m44.js"
148
+ },
149
+ "./m33-m44": {
150
+ "import": "./m33-m44.js"
151
+ },
152
+ "./m44-m33": {
153
+ "import": "./m44-m33.js"
154
+ },
155
+ "./matn": {
156
+ "import": "./matn.js"
157
+ },
158
+ "./matv": {
159
+ "import": "./matv.js"
160
+ },
161
+ "./mixq": {
162
+ "import": "./mixq.js"
163
+ },
164
+ "./mul": {
165
+ "import": "./mul.js"
166
+ },
167
+ "./mulm": {
168
+ "import": "./mulm.js"
169
+ },
170
+ "./muln": {
171
+ "import": "./muln.js"
172
+ },
173
+ "./mulq": {
174
+ "import": "./mulq.js"
175
+ },
176
+ "./mulv": {
177
+ "import": "./mulv.js"
178
+ },
179
+ "./mulvm": {
180
+ "import": "./mulvm.js"
181
+ },
182
+ "./normal-mat": {
183
+ "import": "./normal-mat.js"
184
+ },
185
+ "./orthagonal": {
186
+ "import": "./orthagonal.js"
187
+ },
188
+ "./ortho": {
189
+ "import": "./ortho.js"
190
+ },
191
+ "./outer-product": {
192
+ "import": "./outer-product.js"
193
+ },
194
+ "./perspective": {
195
+ "import": "./perspective.js"
196
+ },
197
+ "./project": {
198
+ "import": "./project.js"
199
+ },
200
+ "./quat-axis-angle": {
201
+ "import": "./quat-axis-angle.js"
202
+ },
203
+ "./quat-euler": {
204
+ "import": "./quat-euler.js"
205
+ },
206
+ "./quat-m33": {
207
+ "import": "./quat-m33.js"
208
+ },
209
+ "./quat-m44": {
210
+ "import": "./quat-m44.js"
211
+ },
212
+ "./rotation-around-axis": {
213
+ "import": "./rotation-around-axis.js"
214
+ },
215
+ "./rotation": {
216
+ "import": "./rotation.js"
217
+ },
218
+ "./row": {
219
+ "import": "./row.js"
220
+ },
221
+ "./scale-center": {
222
+ "import": "./scale-center.js"
223
+ },
224
+ "./scale": {
225
+ "import": "./scale.js"
226
+ },
227
+ "./set": {
228
+ "import": "./set.js"
229
+ },
230
+ "./shear": {
231
+ "import": "./shear.js"
232
+ },
233
+ "./skew": {
234
+ "import": "./skew.js"
235
+ },
236
+ "./sub": {
237
+ "import": "./sub.js"
238
+ },
239
+ "./subn": {
240
+ "import": "./subn.js"
241
+ },
242
+ "./trace": {
243
+ "import": "./trace.js"
244
+ },
245
+ "./transform": {
246
+ "import": "./transform.js"
247
+ },
248
+ "./translation": {
249
+ "import": "./translation.js"
250
+ },
251
+ "./transpose": {
252
+ "import": "./transpose.js"
253
+ },
254
+ "./viewport": {
255
+ "import": "./viewport.js"
256
+ }
257
+ },
85
258
  "thi.ng": {
86
259
  "related": [
87
260
  "color",
@@ -91,5 +264,5 @@
91
264
  ],
92
265
  "year": 2018
93
266
  },
94
- "gitHead": "84a067278ef79ccd538eeb652046eb8e03f3e34e"
267
+ "gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
95
268
  }
package/perspective.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Mat } from "./api";
1
+ import type { Mat } from "./api.js";
2
2
  /**
3
3
  * Creates a 4x4 matrix perspective projection matrix and writes result
4
4
  * to `out`.
package/perspective.js CHANGED
@@ -1,4 +1,4 @@
1
- import { frustum, frustumBounds } from "./frustum";
1
+ import { frustum, frustumBounds } from "./frustum.js";
2
2
  /**
3
3
  * Creates a 4x4 matrix perspective projection matrix and writes result
4
4
  * to `out`.
package/project.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ReadonlyVec, Vec } from "@thi.ng/vectors";
2
- import type { ReadonlyMat } from "./api";
1
+ import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
2
+ import type { ReadonlyMat } from "./api.js";
3
3
  /**
4
4
  * Transforms given point `p` (4D, homogeneous coordinates) with 4x4
5
5
  * matrix `mvp`, applies perspective divide and then transforms XY
package/project.js CHANGED
@@ -1,6 +1,6 @@
1
- import { fromHomogeneous4 } from "@thi.ng/vectors";
2
- import { invert23, invert44 } from "./invert";
3
- import { mulV23, mulV344, mulV44 } from "./mulv";
1
+ import { fromHomogeneous4 } from "@thi.ng/vectors/homogeneous";
2
+ import { invert23, invert44 } from "./invert.js";
3
+ import { mulV23, mulV344, mulV44 } from "./mulv.js";
4
4
  /**
5
5
  * Transforms given point `p` (4D, homogeneous coordinates) with 4x4
6
6
  * matrix `mvp`, applies perspective divide and then transforms XY
@@ -1,4 +1,4 @@
1
- import { ReadonlyVec } from "@thi.ng/vectors";
1
+ import type { ReadonlyVec } from "@thi.ng/vectors";
2
2
  /**
3
3
  * Computes a quaternion representing the rotation `theta` around
4
4
  * `axis`.
@@ -1,5 +1,5 @@
1
- import { EPS } from "@thi.ng/math";
2
- import { normalize } from "@thi.ng/vectors";
1
+ import { EPS } from "@thi.ng/math/api";
2
+ import { normalize } from "@thi.ng/vectors/normalize";
3
3
  /**
4
4
  * Computes a quaternion representing the rotation `theta` around
5
5
  * `axis`.
package/quat-euler.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  declare const axisOrder: {
2
- xyz: import("@thi.ng/vectors").ReadonlyVec[];
3
- yxz: import("@thi.ng/vectors").ReadonlyVec[];
4
- xzy: import("@thi.ng/vectors").ReadonlyVec[];
5
- zxy: import("@thi.ng/vectors").ReadonlyVec[];
6
- yzx: import("@thi.ng/vectors").ReadonlyVec[];
7
- zyx: import("@thi.ng/vectors").ReadonlyVec[];
2
+ xyz: import("@thi.ng/vectors/api").ReadonlyVec[];
3
+ yxz: import("@thi.ng/vectors/api").ReadonlyVec[];
4
+ xzy: import("@thi.ng/vectors/api").ReadonlyVec[];
5
+ zxy: import("@thi.ng/vectors/api").ReadonlyVec[];
6
+ yzx: import("@thi.ng/vectors/api").ReadonlyVec[];
7
+ zyx: import("@thi.ng/vectors/api").ReadonlyVec[];
8
8
  };
9
9
  /**
10
10
  * Constructs a quaternion from given rotation angles in specified
@@ -15,6 +15,6 @@ declare const axisOrder: {
15
15
  * @param b -
16
16
  * @param c -
17
17
  */
18
- export declare const quatFromEuler: (order: keyof typeof axisOrder, a: number, b: number, c: number) => import("@thi.ng/vectors").Vec;
18
+ export declare const quatFromEuler: (order: keyof typeof axisOrder, a: number, b: number, c: number) => import("@thi.ng/vectors/api").Vec;
19
19
  export {};
20
20
  //# sourceMappingURL=quat-euler.d.ts.map
package/quat-euler.js CHANGED
@@ -1,6 +1,6 @@
1
- import { X3, Y3, Z3 } from "@thi.ng/vectors";
2
- import { mulQ } from "./mulq";
3
- import { quatFromAxisAngle } from "./quat-axis-angle";
1
+ import { X3, Y3, Z3 } from "@thi.ng/vectors/api";
2
+ import { mulQ } from "./mulq.js";
3
+ import { quatFromAxisAngle } from "./quat-axis-angle.js";
4
4
  const axisOrder = {
5
5
  xyz: [X3, Y3, Z3],
6
6
  yxz: [Y3, X3, Z3],
package/quat-m33.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpV } from "./api";
1
+ import type { MatOpV } from "./api.js";
2
2
  /**
3
3
  * Converts quaternion into 3x3 matrix and writes result to `out`.
4
4
  *
package/quat-m33.js CHANGED
@@ -1,4 +1,4 @@
1
- import { setC } from "@thi.ng/vectors";
1
+ import { setC } from "@thi.ng/vectors/setc";
2
2
  /**
3
3
  * Converts quaternion into 3x3 matrix and writes result to `out`.
4
4
  *
package/quat-m44.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ReadonlyVec } from "@thi.ng/vectors";
2
- import type { Mat } from "./api";
1
+ import { ReadonlyVec } from "@thi.ng/vectors/api";
2
+ import type { Mat } from "./api.js";
3
3
  /**
4
4
  * Converts quaternion into 4x4 matrix with optional 3D translation offset `t`,
5
5
  * then writes result to `out`.
@@ -7,5 +7,5 @@ import type { Mat } from "./api";
7
7
  * @param out -
8
8
  * @param q -
9
9
  */
10
- export declare const quatToMat44: (out: Mat | null, a: ReadonlyVec, t?: ReadonlyVec) => import("@thi.ng/vectors").Vec;
10
+ export declare const quatToMat44: (out: Mat | null, a: ReadonlyVec, t?: ReadonlyVec) => import("@thi.ng/vectors/api").Vec;
11
11
  //# sourceMappingURL=quat-m44.d.ts.map
package/quat-m44.js CHANGED
@@ -1,4 +1,5 @@
1
- import { setC, ZERO3 } from "@thi.ng/vectors";
1
+ import { ZERO3 } from "@thi.ng/vectors/api";
2
+ import { setC } from "@thi.ng/vectors/setc";
2
3
  /**
3
4
  * Converts quaternion into 4x4 matrix with optional 3D translation offset `t`,
4
5
  * then writes result to `out`.
@@ -1,5 +1,5 @@
1
- import { ReadonlyVec } from "@thi.ng/vectors";
2
- import type { Mat } from "./api";
1
+ import type { ReadonlyVec } from "@thi.ng/vectors";
2
+ import type { Mat } from "./api.js";
3
3
  /**
4
4
  * Constructs a 3x3 matrix representing a rotation of `theta` around
5
5
  * `axis` and writes result to `out`. If `normalize` is true (default
@@ -1,6 +1,7 @@
1
- import { sincos } from "@thi.ng/math";
2
- import { normalize as _normalize, setC } from "@thi.ng/vectors";
3
- import { mat33to44 } from "./m33-m44";
1
+ import { sincos } from "@thi.ng/math/angle";
2
+ import { normalize as _normalize } from "@thi.ng/vectors/normalize";
3
+ import { setC } from "@thi.ng/vectors/setc";
4
+ import { mat33to44 } from "./m33-m44.js";
4
5
  /**
5
6
  * Constructs a 3x3 matrix representing a rotation of `theta` around
6
7
  * `axis` and writes result to `out`. If `normalize` is true (default
package/rotation.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpN } from "./api";
1
+ import type { MatOpN } from "./api.js";
2
2
  /**
3
3
  * Constructs a 2x2 matrix rotation matrix for given `theta`.
4
4
  *
package/rotation.js CHANGED
@@ -1,5 +1,5 @@
1
- import { sincos } from "@thi.ng/math";
2
- import { setC, setC4, setC6 } from "@thi.ng/vectors";
1
+ import { sincos } from "@thi.ng/math/angle";
2
+ import { setC, setC4, setC6 } from "@thi.ng/vectors/setc";
3
3
  /**
4
4
  * Constructs a 2x2 matrix rotation matrix for given `theta`.
5
5
  *
package/row.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MultiVecOpMN } from "./api";
1
+ import type { MultiVecOpMN } from "./api.js";
2
2
  /**
3
3
  * Extracts row vector from given matrix and writes result to `out`. If
4
4
  * `out` is null, creates new vector.
@@ -8,8 +8,8 @@ import type { MultiVecOpMN } from "./api";
8
8
  * @param column -
9
9
  */
10
10
  export declare const row: MultiVecOpMN;
11
- export declare const row22: import("./api").VecOpMN;
12
- export declare const row23: import("./api").VecOpMN;
13
- export declare const row33: import("./api").VecOpMN;
14
- export declare const row44: import("./api").VecOpMN;
11
+ export declare const row22: import("./api.js").VecOpMN;
12
+ export declare const row23: import("./api.js").VecOpMN;
13
+ export declare const row33: import("./api.js").VecOpMN;
14
+ export declare const row44: import("./api.js").VecOpMN;
15
15
  //# sourceMappingURL=row.d.ts.map
package/row.js CHANGED
@@ -1,4 +1,5 @@
1
- import { setS2, setS3, setS4, vop } from "@thi.ng/vectors";
1
+ import { setS2, setS3, setS4 } from "@thi.ng/vectors/sets";
2
+ import { vop } from "@thi.ng/vectors/vop";
2
3
  /**
3
4
  * Extracts row vector from given matrix and writes result to `out`. If
4
5
  * `out` is null, creates new vector.
package/scale-center.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ReadonlyVec } from "@thi.ng/vectors";
2
- import type { Mat } from "./api";
1
+ import type { ReadonlyVec } from "@thi.ng/vectors";
2
+ import type { Mat } from "./api.js";
3
3
  /**
4
4
  * Computes a 2x3 matrix representing a scale operation with origin `p`
5
5
  * and writes result to `out`.
package/scale-center.js CHANGED
@@ -1,7 +1,7 @@
1
- import { neg } from "@thi.ng/vectors";
2
- import { concat } from "./concat";
3
- import { scale23, scale44 } from "./scale";
4
- import { translation23, translation44 } from "./translation";
1
+ import { neg } from "@thi.ng/vectors/neg";
2
+ import { concat } from "./concat.js";
3
+ import { scale23, scale44 } from "./scale.js";
4
+ import { translation23, translation44 } from "./translation.js";
5
5
  /**
6
6
  * Computes a 2x3 matrix representing a scale operation with origin `p`
7
7
  * and writes result to `out`.
package/scale.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpNV } from "./api";
1
+ import type { MatOpNV } from "./api.js";
2
2
  /**
3
3
  * Computes 2x2 matrix scale matrix and writes result to `out`. If `s`
4
4
  * is a number, scaling will be uniform.
package/scale.js CHANGED
@@ -1,5 +1,5 @@
1
- import { isNumber } from "@thi.ng/checks";
2
- import { setC, setC4, setC6 } from "@thi.ng/vectors";
1
+ import { isNumber } from "@thi.ng/checks/is-number";
2
+ import { setC, setC4, setC6 } from "@thi.ng/vectors/setc";
3
3
  /**
4
4
  * Computes 2x2 matrix scale matrix and writes result to `out`. If `s`
5
5
  * is a number, scaling will be uniform.
package/set.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpM } from "./api";
1
+ import type { MatOpM } from "./api.js";
2
2
  export declare const set: MatOpM;
3
3
  export declare const set22: MatOpM;
4
4
  export declare const set23: MatOpM;
package/set.js CHANGED
@@ -1,4 +1,6 @@
1
- import { compile, set as _set, SET, set4 } from "@thi.ng/vectors";
1
+ import { compile } from "@thi.ng/vectors/compile/emit";
2
+ import { SET } from "@thi.ng/vectors/compile/templates";
3
+ import { set as _set, set4 } from "@thi.ng/vectors/set";
2
4
  const $ = (dim) => _set.add(dim, compile(dim, SET, "o,a"));
3
5
  export const set = _set;
4
6
  export const set22 = set4;
package/shear.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpN } from "./api";
1
+ import type { MatOpN } from "./api.js";
2
2
  export declare const shearX22: MatOpN;
3
3
  export declare const shearY22: MatOpN;
4
4
  export declare const shearX23: MatOpN;
package/shear.js CHANGED
@@ -1,4 +1,4 @@
1
- import { identity22, identity23, identity33, identity44 } from "./identity";
1
+ import { identity22, identity23, identity33, identity44 } from "./identity.js";
2
2
  const $ = (f) => (i) => (m, x) => (!m && (m = []), f(m), (m[i] = x), m);
3
3
  const $22 = $(identity22);
4
4
  const $23 = $(identity23);
package/skew.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpN } from "./api";
1
+ import type { MatOpN } from "./api.js";
2
2
  export declare const skewX22: MatOpN;
3
3
  export declare const skewY22: MatOpN;
4
4
  export declare const skewX23: MatOpN;
package/skew.js CHANGED
@@ -1,4 +1,4 @@
1
- import { shearX22, shearX23, shearXY33, shearXY44, shearXZ33, shearXZ44, shearY22, shearY23, shearYX33, shearYX44, shearYZ33, shearYZ44, shearZX33, shearZX44, shearZY33, shearZY44, } from "./shear";
1
+ import { shearX22, shearX23, shearXY33, shearXY44, shearXZ33, shearXZ44, shearY22, shearY23, shearYX33, shearYX44, shearYZ33, shearYZ44, shearZX33, shearZX44, shearZY33, shearZY44, } from "./shear.js";
2
2
  const $ = (f) => (m, theta) => f(m, Math.tan(theta));
3
3
  export const skewX22 = $(shearX22);
4
4
  export const skewY22 = $(shearY22);
package/sub.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpMM, MultiMatOpMM } from "./api";
1
+ import type { MatOpMM, MultiMatOpMM } from "./api.js";
2
2
  /**
3
3
  * Componentwise matrix subtraction. If `out` is not given, writes
4
4
  * result in `a`. Both input matrices MUST be of same size.
package/sub.js CHANGED
@@ -1,5 +1,5 @@
1
- import { sub as _sub, sub4 } from "@thi.ng/vectors";
2
- import { defMath } from "./internal/codegen";
1
+ import { sub as _sub, sub4 } from "@thi.ng/vectors/sub";
2
+ import { defMath } from "./compile/emit.js";
3
3
  /**
4
4
  * Componentwise matrix subtraction. If `out` is not given, writes
5
5
  * result in `a`. Both input matrices MUST be of same size.
package/subn.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpMN, MultiMatOpMN } from "./api";
1
+ import type { MatOpMN, MultiMatOpMN } from "./api.js";
2
2
  /**
3
3
  * Componentwise scalar subtraction. If `out` is not given, writes
4
4
  * result in `mat`.
package/subn.js CHANGED
@@ -1,5 +1,5 @@
1
- import { subN as _subN, subN4 } from "@thi.ng/vectors";
2
- import { defMathN } from "./internal/codegen";
1
+ import { subN as _subN, subN4 } from "@thi.ng/vectors/subn";
2
+ import { defMathN } from "./compile/emit.js";
3
3
  /**
4
4
  * Componentwise scalar subtraction. If `out` is not given, writes
5
5
  * result in `mat`.
package/trace.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ReadonlyMat } from "./api";
1
+ import type { ReadonlyMat } from "./api.js";
2
2
  /**
3
3
  * Returns matrix trace of `m`, i.e. component sum of `diag(m)`.
4
4
  *
package/trace.js CHANGED
@@ -1,5 +1,5 @@
1
- import { sum } from "@thi.ng/vectors";
2
- import { diag } from "./diag";
1
+ import { sum } from "@thi.ng/vectors/sum";
2
+ import { diag } from "./diag.js";
3
3
  /**
4
4
  * Returns matrix trace of `m`, i.e. component sum of `diag(m)`.
5
5
  *
package/transform.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ReadonlyVec } from "@thi.ng/vectors";
2
- import type { Mat } from "./api";
2
+ import type { Mat } from "./api.js";
3
3
  /**
4
4
  * Creates 2x3 TRS transformation matrix from given translation vector,
5
5
  * rotation angle and scale factor/vector.
package/transform.js CHANGED
@@ -1,10 +1,10 @@
1
- import { concat } from "./concat";
2
- import { mulM44 } from "./mulm";
3
- import { quatFromEuler } from "./quat-euler";
4
- import { quatToMat44 } from "./quat-m44";
5
- import { rotation23 } from "./rotation";
6
- import { scale23, scale44 } from "./scale";
7
- import { translation23 } from "./translation";
1
+ import { concat } from "./concat.js";
2
+ import { mulM44 } from "./mulm.js";
3
+ import { quatFromEuler } from "./quat-euler.js";
4
+ import { quatToMat44 } from "./quat-m44.js";
5
+ import { rotation23 } from "./rotation.js";
6
+ import { scale23, scale44 } from "./scale.js";
7
+ import { translation23 } from "./translation.js";
8
8
  /**
9
9
  * Creates 2x3 TRS transformation matrix from given translation vector,
10
10
  * rotation angle and scale factor/vector.
package/translation.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ReadonlyVec } from "@thi.ng/vectors";
2
- import type { Mat } from "./api";
1
+ import type { ReadonlyVec } from "@thi.ng/vectors";
2
+ import type { Mat } from "./api.js";
3
3
  /**
4
4
  * Constructs a 2x3 translation matrix.
5
5
  *
package/translation.js CHANGED
@@ -1,4 +1,4 @@
1
- import { setC, setC6 } from "@thi.ng/vectors";
1
+ import { setC, setC6 } from "@thi.ng/vectors/setc";
2
2
  /**
3
3
  * Constructs a 2x3 translation matrix.
4
4
  *
package/transpose.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MatOpM } from "./api";
1
+ import type { MatOpM } from "./api.js";
2
2
  /**
3
3
  * Writes transposition of 2x2 matrix `m` to `out`. Creates new matrix
4
4
  * if `out` is `null`
package/transpose.js CHANGED
@@ -1,4 +1,4 @@
1
- import { setC, setC4 } from "@thi.ng/vectors";
1
+ import { setC, setC4 } from "@thi.ng/vectors/setc";
2
2
  /**
3
3
  * Writes transposition of 2x2 matrix `m` to `out`. Creates new matrix
4
4
  * if `out` is `null`