curvy 1.0.9 → 2.0.0-alpha.10

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 (204) hide show
  1. package/dist/characteristic/characteristic.d.ts +80 -0
  2. package/dist/characteristic/index.d.ts +1 -0
  3. package/dist/characteristic/index.mjs +2 -0
  4. package/dist/curve/cubic2d.d.ts +133 -27
  5. package/dist/curve/cubic2d.internal.d.ts +2 -0
  6. package/dist/curve/index.d.ts +12 -0
  7. package/dist/curve/index.mjs +2 -0
  8. package/dist/curve/linear2d.d.ts +125 -24
  9. package/dist/curve/linear2d.internal.d.ts +2 -0
  10. package/dist/curve/quadratic2d.d.ts +134 -28
  11. package/dist/curve/quadratic2d.internal.d.ts +2 -0
  12. package/dist/curve/rationalCubic2d.d.ts +241 -0
  13. package/dist/curve/rationalCubic2d.internal.d.ts +2 -0
  14. package/dist/dimensions.d.ts +23 -0
  15. package/dist/interval/index.d.ts +6 -0
  16. package/dist/interval/index.mjs +3 -0
  17. package/dist/interval/interval.d.ts +525 -0
  18. package/dist/interval/interval.internal.d.ts +1 -0
  19. package/dist/interval/interval2d.d.ts +204 -0
  20. package/dist/interval/interval2d.internal.d.ts +2 -0
  21. package/dist/length.d.ts +32 -0
  22. package/dist/matrix/index.d.ts +9 -0
  23. package/dist/matrix/index.mjs +267 -0
  24. package/dist/matrix/index.mjs.map +1 -0
  25. package/dist/matrix/matrix2x2.d.ts +44 -29
  26. package/dist/matrix/matrix2x2.internal.d.ts +2 -0
  27. package/dist/matrix/matrix3x3.d.ts +64 -38
  28. package/dist/matrix/matrix3x3.internal.d.ts +4 -0
  29. package/dist/matrix/matrix4x4.d.ts +92 -34
  30. package/dist/matrix/matrix4x4.internal.d.ts +2 -0
  31. package/dist/number.d.ts +276 -0
  32. package/dist/number.mjs +140 -0
  33. package/dist/number.mjs.map +1 -0
  34. package/dist/path/cubic2d.d.ts +192 -25
  35. package/dist/path/cubic2d.internal.d.ts +2 -0
  36. package/dist/path/index.d.ts +12 -0
  37. package/dist/path/index.mjs +734 -0
  38. package/dist/path/index.mjs.map +1 -0
  39. package/dist/path/linear2d.d.ts +175 -25
  40. package/dist/path/linear2d.internal.d.ts +2 -0
  41. package/dist/path/quadratic2d.d.ts +165 -26
  42. package/dist/path/quadratic2d.internal.d.ts +2 -0
  43. package/dist/path/rationalCubic2d.d.ts +116 -0
  44. package/dist/path/rationalCubic2d.internal.d.ts +2 -0
  45. package/dist/path/traits.d.ts +95 -0
  46. package/dist/polynomial/cubic.d.ts +377 -7
  47. package/dist/polynomial/cubic.internal.circular.d.ts +2 -0
  48. package/dist/polynomial/cubic.internal.d.ts +1 -0
  49. package/dist/polynomial/index.d.ts +9 -0
  50. package/dist/polynomial/index.mjs +3 -0
  51. package/dist/polynomial/linear.d.ts +317 -7
  52. package/dist/polynomial/linear.internal.d.ts +2 -0
  53. package/dist/polynomial/monotonicity.d.ts +3 -0
  54. package/dist/polynomial/quadratic.d.ts +371 -7
  55. package/dist/polynomial/quadratic.internal.circular.d.ts +2 -0
  56. package/dist/polynomial/quadratic.internal.d.ts +1 -0
  57. package/dist/polynomial/traits.d.ts +56 -0
  58. package/dist/shared/characteristic-B0VEB_OA.mjs +104 -0
  59. package/dist/shared/characteristic-B0VEB_OA.mjs.map +1 -0
  60. package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
  61. package/dist/shared/cubic-NEn7E6V_.mjs +575 -0
  62. package/dist/shared/cubic-NEn7E6V_.mjs.map +1 -0
  63. package/dist/shared/interval-CqC3ZIqj.mjs +460 -0
  64. package/dist/shared/interval-CqC3ZIqj.mjs.map +1 -0
  65. package/dist/shared/interval2d-C0eduE-V.mjs +149 -0
  66. package/dist/shared/interval2d-C0eduE-V.mjs.map +1 -0
  67. package/dist/shared/matrix4x4-BWmf4lZM.mjs +499 -0
  68. package/dist/shared/matrix4x4-BWmf4lZM.mjs.map +1 -0
  69. package/dist/shared/quadratic-Dlxqo2V1.mjs +348 -0
  70. package/dist/shared/quadratic-Dlxqo2V1.mjs.map +1 -0
  71. package/dist/shared/rationalCubic2d-3S5K69Jy.mjs +909 -0
  72. package/dist/shared/rationalCubic2d-3S5K69Jy.mjs.map +1 -0
  73. package/dist/shared/rationalCubic2d-CJY-feGw.mjs +508 -0
  74. package/dist/shared/rationalCubic2d-CJY-feGw.mjs.map +1 -0
  75. package/dist/shared/solution-UKGK826h.mjs +352 -0
  76. package/dist/shared/solution-UKGK826h.mjs.map +1 -0
  77. package/dist/shared/vector2-CSkaMXvp.mjs +205 -0
  78. package/dist/shared/vector2-CSkaMXvp.mjs.map +1 -0
  79. package/dist/shared/vector2.internal-DP1nTBdS.mjs +141 -0
  80. package/dist/shared/vector2.internal-DP1nTBdS.mjs.map +1 -0
  81. package/dist/shared/vector3-CR2LPV03.mjs +226 -0
  82. package/dist/shared/vector3-CR2LPV03.mjs.map +1 -0
  83. package/dist/shared/vector4-PO_7EYd-.mjs +171 -0
  84. package/dist/shared/vector4-PO_7EYd-.mjs.map +1 -0
  85. package/dist/shared/vector4.internal-BJ1QN2Ck.mjs +246 -0
  86. package/dist/shared/vector4.internal-BJ1QN2Ck.mjs.map +1 -0
  87. package/dist/solution/index.d.ts +1 -0
  88. package/dist/solution/index.mjs +2 -0
  89. package/dist/solution/solution.d.ts +264 -0
  90. package/dist/solution/solution.internal.d.ts +2 -0
  91. package/dist/splines/basis2d.d.ts +26 -38
  92. package/dist/splines/basis2d.internal.d.ts +2 -0
  93. package/dist/splines/bezier2d.d.ts +61 -45
  94. package/dist/splines/bezier2d.internal.d.ts +2 -0
  95. package/dist/splines/cardinal2d.d.ts +179 -88
  96. package/dist/splines/cardinal2d.internal.d.ts +2 -0
  97. package/dist/splines/hermite2d.d.ts +25 -36
  98. package/dist/splines/hermite2d.internal.d.ts +2 -0
  99. package/dist/splines/index.d.ts +15 -0
  100. package/dist/splines/index.mjs +946 -0
  101. package/dist/splines/index.mjs.map +1 -0
  102. package/dist/splines/rationalBezier2d.d.ts +144 -0
  103. package/dist/splines/rationalBezier2d.internal.d.ts +2 -0
  104. package/dist/splines/util.d.ts +5 -0
  105. package/dist/utils.d.ts +54 -186
  106. package/dist/utils.mjs +88 -52
  107. package/dist/utils.mjs.map +1 -1
  108. package/dist/vector/index.d.ts +9 -0
  109. package/dist/vector/index.mjs +4 -0
  110. package/dist/vector/vector2.d.ts +238 -33
  111. package/dist/vector/vector2.internal.d.ts +4 -0
  112. package/dist/vector/vector3.d.ts +198 -41
  113. package/dist/vector/vector3.internal.d.ts +2 -0
  114. package/dist/vector/vector4.d.ts +260 -23
  115. package/dist/vector/vector4.internal.d.ts +2 -0
  116. package/package.json +48 -91
  117. package/dist/curve/cubic2d.d.mts +0 -109
  118. package/dist/curve/cubic2d.mjs +0 -80
  119. package/dist/curve/cubic2d.mjs.map +0 -1
  120. package/dist/curve/linear2d.d.mts +0 -94
  121. package/dist/curve/linear2d.mjs +0 -46
  122. package/dist/curve/linear2d.mjs.map +0 -1
  123. package/dist/curve/quadratic2d.d.mts +0 -117
  124. package/dist/curve/quadratic2d.mjs +0 -82
  125. package/dist/curve/quadratic2d.mjs.map +0 -1
  126. package/dist/interval.d.mts +0 -251
  127. package/dist/interval.d.ts +0 -251
  128. package/dist/interval.mjs +0 -86
  129. package/dist/interval.mjs.map +0 -1
  130. package/dist/matrix/matrix2x2.d.mts +0 -320
  131. package/dist/matrix/matrix2x2.mjs +0 -25
  132. package/dist/matrix/matrix2x2.mjs.map +0 -1
  133. package/dist/matrix/matrix3x3.d.mts +0 -370
  134. package/dist/matrix/matrix3x3.mjs +0 -28
  135. package/dist/matrix/matrix3x3.mjs.map +0 -1
  136. package/dist/matrix/matrix4x4.d.mts +0 -381
  137. package/dist/matrix/matrix4x4.mjs +0 -178
  138. package/dist/matrix/matrix4x4.mjs.map +0 -1
  139. package/dist/path/cubic2d.d.mts +0 -95
  140. package/dist/path/cubic2d.mjs +0 -60
  141. package/dist/path/cubic2d.mjs.map +0 -1
  142. package/dist/path/linear2d.d.mts +0 -95
  143. package/dist/path/linear2d.mjs +0 -53
  144. package/dist/path/linear2d.mjs.map +0 -1
  145. package/dist/path/quadratic2d.d.mts +0 -95
  146. package/dist/path/quadratic2d.mjs +0 -57
  147. package/dist/path/quadratic2d.mjs.map +0 -1
  148. package/dist/pipe.d.mts +0 -58
  149. package/dist/pipe.d.ts +0 -58
  150. package/dist/pipe.mjs +0 -92
  151. package/dist/pipe.mjs.map +0 -1
  152. package/dist/polynomial/cubic.d.mts +0 -7
  153. package/dist/polynomial/cubic.mjs +0 -133
  154. package/dist/polynomial/cubic.mjs.map +0 -1
  155. package/dist/polynomial/linear.d.mts +0 -7
  156. package/dist/polynomial/linear.mjs +0 -24
  157. package/dist/polynomial/linear.mjs.map +0 -1
  158. package/dist/polynomial/quadratic.d.mts +0 -7
  159. package/dist/polynomial/quadratic.mjs +0 -27
  160. package/dist/polynomial/quadratic.mjs.map +0 -1
  161. package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
  162. package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
  163. package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
  164. package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
  165. package/dist/shared/curvy.BxdGW9he.mjs +0 -116
  166. package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
  167. package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
  168. package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
  169. package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
  170. package/dist/shared/curvy.DCt1gGII.mjs +0 -147
  171. package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
  172. package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
  173. package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
  174. package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
  175. package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
  176. package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
  177. package/dist/shared/curvy.lktriTpx.mjs +0 -101
  178. package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
  179. package/dist/shared/curvy.mLFprrGm.mjs +0 -85
  180. package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
  181. package/dist/shared/curvy.r6f1j287.mjs +0 -76
  182. package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
  183. package/dist/splines/basis2d.d.mts +0 -130
  184. package/dist/splines/basis2d.mjs +0 -90
  185. package/dist/splines/basis2d.mjs.map +0 -1
  186. package/dist/splines/bezier2d.d.mts +0 -182
  187. package/dist/splines/bezier2d.mjs +0 -23
  188. package/dist/splines/bezier2d.mjs.map +0 -1
  189. package/dist/splines/cardinal2d.d.mts +0 -178
  190. package/dist/splines/cardinal2d.mjs +0 -114
  191. package/dist/splines/cardinal2d.mjs.map +0 -1
  192. package/dist/splines/hermite2d.d.mts +0 -124
  193. package/dist/splines/hermite2d.mjs +0 -63
  194. package/dist/splines/hermite2d.mjs.map +0 -1
  195. package/dist/utils.d.mts +0 -205
  196. package/dist/vector/vector2.d.mts +0 -324
  197. package/dist/vector/vector2.mjs +0 -30
  198. package/dist/vector/vector2.mjs.map +0 -1
  199. package/dist/vector/vector3.d.mts +0 -417
  200. package/dist/vector/vector3.mjs +0 -38
  201. package/dist/vector/vector3.mjs.map +0 -1
  202. package/dist/vector/vector4.d.mts +0 -205
  203. package/dist/vector/vector4.mjs +0 -20
  204. package/dist/vector/vector4.mjs.map +0 -1
@@ -1,16 +1,13 @@
1
- import { d as TwoDimensionalIndex, e as TwoDimensionalComponent } from '../shared/curvy.Bf5TIk31.js';
2
- import { Pipeable } from '../pipe.js';
3
- import { Vector2 } from '../vector/vector2.js';
4
-
5
- declare const Matrix2x2TypeId: unique symbol;
6
- type Matrix2x2TypeId = typeof Matrix2x2TypeId;
7
-
1
+ import type { TwoDimensionalComponent, TwoDimensionalIndex } from '../dimensions.ts';
2
+ import type { Pipeable } from '../utils.ts';
3
+ import type { Vector2 } from '../vector/vector2.ts';
4
+ import type { Matrix2x2TypeId } from './matrix2x2.internal.ts';
8
5
  /**
9
6
  * A type representing the coordinate of a 2D matrix.
10
7
  *
11
8
  * @since 1.0.0
12
9
  */
13
- type Matrix2x2Coordinate = TwoDimensionalIndex | TwoDimensionalComponent;
10
+ export type Matrix2x2Coordinate = TwoDimensionalIndex | TwoDimensionalComponent;
14
11
  /**
15
12
  * A 2D matrix with 2 rows and 2 columns.
16
13
  *
@@ -18,7 +15,7 @@ type Matrix2x2Coordinate = TwoDimensionalIndex | TwoDimensionalComponent;
18
15
  *
19
16
  * @since 1.0.0
20
17
  */
21
- interface Matrix2x2 extends Pipeable {
18
+ export interface Matrix2x2 extends Pipeable {
22
19
  readonly [Matrix2x2TypeId]: Matrix2x2TypeId;
23
20
  /**
24
21
  * The value in the first row and first column.
@@ -44,7 +41,28 @@ interface Matrix2x2 extends Pipeable {
44
41
  * @returns `true` if the value is a `Matrix2x2`, `false` otherwise.
45
42
  * @since 1.0.0
46
43
  */
47
- declare const isMatrix2x2: (m: unknown) => m is Matrix2x2;
44
+ export declare const isMatrix2x2: (m: unknown) => m is Matrix2x2;
45
+ export declare const equals: {
46
+ /**
47
+ * Checks if two `Matrix2x2` instances are approximately equal within the
48
+ * default absolute tolerance ({@link EPSILON}).
49
+ *
50
+ * @param a - The first matrix.
51
+ * @param b - The second matrix.
52
+ * @returns `true` when each pair of components is within tolerance.
53
+ * @since 1.1.0
54
+ */
55
+ (a: Matrix2x2, b: Matrix2x2): boolean;
56
+ /**
57
+ * Checks if two `Matrix2x2` instances are approximately equal within the
58
+ * default absolute tolerance ({@link EPSILON}).
59
+ *
60
+ * @param b - The second matrix.
61
+ * @returns A function that takes the first matrix and returns the comparison result.
62
+ * @since 1.1.0
63
+ */
64
+ (b: Matrix2x2): (a: Matrix2x2) => boolean;
65
+ };
48
66
  /**
49
67
  * Creates a new `Matrix2x2` instance.
50
68
  *
@@ -53,7 +71,7 @@ declare const isMatrix2x2: (m: unknown) => m is Matrix2x2;
53
71
  * @param m10 - The value in the second row and first column. Defaults to 0.
54
72
  * @param m11 - The value in the second row and second column. Defaults to 0.
55
73
  */
56
- declare const make: (m00?: number, m01?: number, m10?: number, m11?: number) => Matrix2x2;
74
+ export declare const make: (m00?: number, m01?: number, m10?: number, m11?: number) => Matrix2x2;
57
75
  /**
58
76
  * Creates a new `Matrix2x2` instance from two vectors representing rows.
59
77
  *
@@ -62,7 +80,7 @@ declare const make: (m00?: number, m01?: number, m10?: number, m11?: number) =>
62
80
  * @returns A new `Matrix2x2` instance.
63
81
  * @since 1.0.0
64
82
  */
65
- declare const fromRows: (v0: Vector2, v1: Vector2) => Matrix2x2;
83
+ export declare const fromRows: (v0: Vector2, v1: Vector2) => Matrix2x2;
66
84
  /**
67
85
  * Creates a new `Matrix2x2` instance from two vectors representing columns.
68
86
  *
@@ -71,8 +89,8 @@ declare const fromRows: (v0: Vector2, v1: Vector2) => Matrix2x2;
71
89
  * @returns A new `Matrix2x2` instance.
72
90
  * @since 1.0.0
73
91
  */
74
- declare const fromColumns: (v0: Vector2, v1: Vector2) => Matrix2x2;
75
- declare const setRow: {
92
+ export declare const fromColumns: (v0: Vector2, v1: Vector2) => Matrix2x2;
93
+ export declare const setRow: {
76
94
  /**
77
95
  * Sets the specified row of the matrix to the given vector.
78
96
  *
@@ -93,7 +111,7 @@ declare const setRow: {
93
111
  */
94
112
  (row: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2;
95
113
  };
96
- declare const setColumn: {
114
+ export declare const setColumn: {
97
115
  /**
98
116
  * Sets the specified column of the matrix to the given vector.
99
117
  *
@@ -121,8 +139,8 @@ declare const setColumn: {
121
139
  * @returns The determinant of the matrix.
122
140
  * @since 1.0.0
123
141
  */
124
- declare const determinant: (m: Matrix2x2) => number;
125
- declare const vectorProductLeft: {
142
+ export declare const determinant: (m: Matrix2x2) => number;
143
+ export declare const vectorProductLeft: {
126
144
  /**
127
145
  * Calculates the left vector product of a matrix and a vector.
128
146
  *
@@ -167,7 +185,7 @@ declare const vectorProductLeft: {
167
185
  */
168
186
  (v: Vector2): (m: Matrix2x2) => Vector2;
169
187
  };
170
- declare const vectorProductRight: {
188
+ export declare const vectorProductRight: {
171
189
  /**
172
190
  * Calculates the right vector product of a matrix and a vector.
173
191
  *
@@ -212,7 +230,7 @@ declare const vectorProductRight: {
212
230
  */
213
231
  (v: Vector2): (m: Matrix2x2) => Vector2;
214
232
  };
215
- declare const solveSystem: {
233
+ export declare const solveSystem: {
216
234
  /**
217
235
  * Solves a system of linear equations represented by a matrix and a vector.
218
236
  *
@@ -264,7 +282,7 @@ declare const solveSystem: {
264
282
  * @returns An array of vectors representing the rows of the matrix.
265
283
  * @since 1.0.0
266
284
  */
267
- declare const toRows: (m: Matrix2x2) => [Vector2, Vector2];
285
+ export declare const toRows: (m: Matrix2x2) => [Vector2, Vector2];
268
286
  /**
269
287
  * Returns the columns of a matrix as an array of vectors.
270
288
  *
@@ -272,7 +290,7 @@ declare const toRows: (m: Matrix2x2) => [Vector2, Vector2];
272
290
  * @returns An array of vectors representing the columns of the matrix.
273
291
  * @since 1.0.0
274
292
  */
275
- declare const toColumns: (m: Matrix2x2) => [Vector2, Vector2];
293
+ export declare const toColumns: (m: Matrix2x2) => [Vector2, Vector2];
276
294
  /**
277
295
  * Returns the specified row of a matrix as a vector.
278
296
  *
@@ -281,7 +299,7 @@ declare const toColumns: (m: Matrix2x2) => [Vector2, Vector2];
281
299
  * @returns A vector representing the specified row of the matrix.
282
300
  * @since 1.0.0
283
301
  */
284
- declare const rowVector: (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2;
302
+ export declare const rowVector: (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2;
285
303
  /**
286
304
  * Returns the specified column of a matrix as a vector.
287
305
  *
@@ -290,7 +308,7 @@ declare const rowVector: (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2;
290
308
  * @returns A vector representing the specified column of the matrix.
291
309
  * @since 1.0.0
292
310
  */
293
- declare const columnVector: (m: Matrix2x2, column: Matrix2x2Coordinate) => Vector2;
311
+ export declare const columnVector: (m: Matrix2x2, column: Matrix2x2Coordinate) => Vector2;
294
312
  /**
295
313
  * Transposes a matrix.
296
314
  *
@@ -298,7 +316,7 @@ declare const columnVector: (m: Matrix2x2, column: Matrix2x2Coordinate) => Vecto
298
316
  * @returns A new `Matrix2x2` instance representing the transposed matrix.
299
317
  * @since 1.0.0
300
318
  */
301
- declare const transpose: (m: Matrix2x2) => Matrix2x2;
319
+ export declare const transpose: (m: Matrix2x2) => Matrix2x2;
302
320
  /**
303
321
  * Reverses the rows of a matrix.
304
322
  *
@@ -306,7 +324,7 @@ declare const transpose: (m: Matrix2x2) => Matrix2x2;
306
324
  * @returns A new `Matrix2x2` instance with the rows reversed.
307
325
  * @since 1.0.0
308
326
  */
309
- declare const reverseRows: (m: Matrix2x2) => Matrix2x2;
327
+ export declare const reverseRows: (m: Matrix2x2) => Matrix2x2;
310
328
  /**
311
329
  * Reverses the columns of a matrix.
312
330
  *
@@ -314,7 +332,4 @@ declare const reverseRows: (m: Matrix2x2) => Matrix2x2;
314
332
  * @returns A new `Matrix2x2` instance with the columns reversed.
315
333
  * @since 1.0.0
316
334
  */
317
- declare const reverseColumns: (m: Matrix2x2) => Matrix2x2;
318
-
319
- export { columnVector, determinant, fromColumns, fromRows, isMatrix2x2, make, reverseColumns, reverseRows, rowVector, setColumn, setRow, solveSystem, toColumns, toRows, transpose, vectorProductLeft, vectorProductRight };
320
- export type { Matrix2x2, Matrix2x2Coordinate };
335
+ export declare const reverseColumns: (m: Matrix2x2) => Matrix2x2;
@@ -0,0 +1,2 @@
1
+ export declare const Matrix2x2TypeId: unique symbol;
2
+ export type Matrix2x2TypeId = typeof Matrix2x2TypeId;
@@ -1,18 +1,14 @@
1
- import { b as ThreeDimensionalIndex, c as ThreeDimensionalComponent } from '../shared/curvy.Bf5TIk31.js';
2
- import { Pipeable } from '../pipe.js';
3
- import { Vector3 } from '../vector/vector3.js';
4
- import { Matrix2x2 } from './matrix2x2.js';
5
- import '../vector/vector2.js';
6
-
7
- declare const Matrix3x3TypeId: unique symbol;
8
- type Matrix3x3TypeId = typeof Matrix3x3TypeId;
9
-
1
+ import type { ThreeDimensionalComponent, ThreeDimensionalIndex } from '../dimensions.ts';
2
+ import type { Pipeable } from '../utils.ts';
3
+ import type { Vector3 } from '../vector/vector3.ts';
4
+ import type { Matrix2x2 } from './matrix2x2.ts';
5
+ import type { Matrix3x3TypeId } from './matrix3x3.internal.ts';
10
6
  /**
11
7
  * A coordinate in a 3x3 matrix.
12
8
  *
13
9
  * @since 1.0.0
14
10
  */
15
- type Matrix3x3Coordinate = ThreeDimensionalIndex | ThreeDimensionalComponent;
11
+ export type Matrix3x3Coordinate = ThreeDimensionalIndex | ThreeDimensionalComponent;
16
12
  /**
17
13
  * A 3x3 matrix.
18
14
  *
@@ -20,7 +16,7 @@ type Matrix3x3Coordinate = ThreeDimensionalIndex | ThreeDimensionalComponent;
20
16
  *
21
17
  * @since 1.0.0
22
18
  */
23
- interface Matrix3x3 extends Pipeable {
19
+ export interface Matrix3x3 extends Pipeable {
24
20
  readonly [Matrix3x3TypeId]: Matrix3x3TypeId;
25
21
  /**
26
22
  * The value of the first row and first column.
@@ -66,7 +62,28 @@ interface Matrix3x3 extends Pipeable {
66
62
  * @returns `true` if the value is a `Matrix3x3`, `false` otherwise.
67
63
  * @since 1.0.0
68
64
  */
69
- declare const isMatrix3x3: (m: unknown) => m is Matrix3x3;
65
+ export declare const isMatrix3x3: (m: unknown) => m is Matrix3x3;
66
+ export declare const equals: {
67
+ /**
68
+ * Checks if two `Matrix3x3` instances are approximately equal within the
69
+ * default absolute tolerance ({@link EPSILON}).
70
+ *
71
+ * @param a - The first matrix.
72
+ * @param b - The second matrix.
73
+ * @returns `true` when each pair of components is within tolerance.
74
+ * @since 1.1.0
75
+ */
76
+ (a: Matrix3x3, b: Matrix3x3): boolean;
77
+ /**
78
+ * Checks if two `Matrix3x3` instances are approximately equal within the
79
+ * default absolute tolerance ({@link EPSILON}).
80
+ *
81
+ * @param b - The second matrix.
82
+ * @returns A function that takes the first matrix and returns the comparison result.
83
+ * @since 1.1.0
84
+ */
85
+ (b: Matrix3x3): (a: Matrix3x3) => boolean;
86
+ };
70
87
  /**
71
88
  * Creates a new `Matrix3x3` instance.
72
89
  *
@@ -82,7 +99,7 @@ declare const isMatrix3x3: (m: unknown) => m is Matrix3x3;
82
99
  * @returns A new `Matrix3x3` instance.
83
100
  * @since 1.0.0
84
101
  */
85
- declare const matrix3x3: (m00?: number, m01?: number, m02?: number, m10?: number, m11?: number, m12?: number, m20?: number, m21?: number, m22?: number) => Matrix3x3;
102
+ export declare const make: (m00?: number, m01?: number, m02?: number, m10?: number, m11?: number, m12?: number, m20?: number, m21?: number, m22?: number) => Matrix3x3;
86
103
  /**
87
104
  * Creates a new `Matrix3x3` instance from three row vectors.
88
105
  *
@@ -92,7 +109,7 @@ declare const matrix3x3: (m00?: number, m01?: number, m02?: number, m10?: number
92
109
  * @returns A new `Matrix3x3` instance.
93
110
  * @since 1.0.0
94
111
  */
95
- declare const fromRows: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
112
+ export declare const fromRows: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
96
113
  /**
97
114
  * Creates a new `Matrix3x3` instance from three column vectors.
98
115
  *
@@ -102,8 +119,8 @@ declare const fromRows: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
102
119
  * @returns A new `Matrix3x3` instance.
103
120
  * @since 1.0.0
104
121
  */
105
- declare const fromColumns: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
106
- declare const setRow: {
122
+ export declare const fromColumns: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
123
+ export declare const setRow: {
107
124
  /**
108
125
  * Sets a row of the matrix to a new vector.
109
126
  *
@@ -111,6 +128,7 @@ declare const setRow: {
111
128
  * @param row - The row index to set.
112
129
  * @param v - The new vector for the row.
113
130
  * @returns A new matrix with the specified row set to the new vector.
131
+ * @since 1.0.0
114
132
  */
115
133
  (m: Matrix3x3, row: Matrix3x3Coordinate, v: Vector3): Matrix3x3;
116
134
  /**
@@ -119,10 +137,11 @@ declare const setRow: {
119
137
  * @param row - The row index to set.
120
138
  * @param v - The new vector for the row.
121
139
  * @returns A function that takes a matrix and returns a new matrix with the specified row set to the new vector.
140
+ * @since 1.0.0
122
141
  */
123
142
  (row: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3;
124
143
  };
125
- declare const setColumn: {
144
+ export declare const setColumn: {
126
145
  /**
127
146
  * Sets a column of the matrix to a new vector.
128
147
  *
@@ -130,6 +149,7 @@ declare const setColumn: {
130
149
  * @param column - The column index to set.
131
150
  * @param v - The new vector for the column.
132
151
  * @returns A new matrix with the specified column set to the new vector.
152
+ * @since 1.0.0
133
153
  */
134
154
  (m: Matrix3x3, column: Matrix3x3Coordinate, v: Vector3): Matrix3x3;
135
155
  /**
@@ -138,6 +158,7 @@ declare const setColumn: {
138
158
  * @param column - The column index to set.
139
159
  * @param v - The new vector for the column.
140
160
  * @returns A function that takes a matrix and returns a new matrix with the specified column set to the new vector.
161
+ * @since 1.0.0
141
162
  */
142
163
  (column: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3;
143
164
  };
@@ -148,7 +169,7 @@ declare const setColumn: {
148
169
  * @returns The determinant of the matrix.
149
170
  * @since 1.0.0
150
171
  */
151
- declare const determinant: (m: Matrix3x3) => number;
172
+ export declare const determinant: (m: Matrix3x3) => number;
152
173
  /**
153
174
  * Calculates the minor of a 3x3 matrix.
154
175
  *
@@ -158,8 +179,8 @@ declare const determinant: (m: Matrix3x3) => number;
158
179
  * @returns The minor of the matrix at the specified row and column.
159
180
  * @since 1.0.0
160
181
  */
161
- declare const minor: (m: Matrix3x3, row: Matrix3x3Coordinate, column: Matrix3x3Coordinate) => Matrix2x2;
162
- declare const vectorProductLeft: {
182
+ export declare const minor: (m: Matrix3x3, row: Matrix3x3Coordinate, column: Matrix3x3Coordinate) => Matrix2x2;
183
+ export declare const vectorProductLeft: {
163
184
  /**
164
185
  * Calculates the left vector product of a matrix and a vector.
165
186
  *
@@ -168,7 +189,7 @@ declare const vectorProductLeft: {
168
189
  * import * as Matrix3x3 from 'curvy/matrix3x3'
169
190
  * import * as Vector3 from 'curvy/vector3'
170
191
  *
171
- * const m = Matrix3x3.matrix3x3(1, 2, 3, 4, 5, 6, 7, 8, 9)
192
+ * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
172
193
  * const v = Vector3.vector3(10, 11, 12)
173
194
  *
174
195
  * // Performs:
@@ -191,7 +212,7 @@ declare const vectorProductLeft: {
191
212
  * import * as Matrix3x3 from 'curvy/matrix3x3'
192
213
  * import * as Vector3 from 'curvy/vector3'
193
214
  *
194
- * const m = Matrix3x3.matrix3x3(1, 2, 3, 4, 5, 6, 7, 8, 9)
215
+ * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
195
216
  * const v = Vector3.vector3(10, 11, 12)
196
217
  *
197
218
  * // Performs:
@@ -202,10 +223,11 @@ declare const vectorProductLeft: {
202
223
  * ```
203
224
  * @param v - The vector to calculate the left vector product with.
204
225
  * @returns A function that takes a matrix and returns the resulting vector from the left vector product.
226
+ * @since 1.0.0
205
227
  */
206
228
  (v: Vector3): (m: Matrix3x3) => Vector3;
207
229
  };
208
- declare const vectorProductRight: {
230
+ export declare const vectorProductRight: {
209
231
  /**
210
232
  * Calculates the right vector product of a matrix and a vector.
211
233
  *
@@ -214,7 +236,7 @@ declare const vectorProductRight: {
214
236
  * import * as Matrix3x3 from 'curvy/matrix3x3'
215
237
  * import * as Vector3 from 'curvy/vector3'
216
238
  *
217
- * const m = Matrix3x3.matrix3x3(1, 2, 3, 4, 5, 6, 7, 8, 9)
239
+ * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
218
240
  * const v = Vector3.vector3(10, 11, 12)
219
241
  *
220
242
  * // Performs:
@@ -226,6 +248,7 @@ declare const vectorProductRight: {
226
248
  * @param m - The matrix to calculate the right vector product with.
227
249
  * @param v - The vector to calculate the right vector product with.
228
250
  * @returns The resulting vector from the right vector product.
251
+ * @since 1.0.0
229
252
  */
230
253
  (m: Matrix3x3, v: Vector3): Vector3;
231
254
  /**
@@ -236,7 +259,7 @@ declare const vectorProductRight: {
236
259
  * import * as Matrix3x3 from 'curvy/matrix3x3'
237
260
  * import * as Vector3 from 'curvy/vector3'
238
261
  *
239
- * const m = Matrix3x3.matrix3x3(1, 2, 3, 4, 5, 6, 7, 8, 9)
262
+ * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
240
263
  * const v = Vector3.vector3(10, 11, 12)
241
264
  *
242
265
  * // Performs:
@@ -251,7 +274,7 @@ declare const vectorProductRight: {
251
274
  */
252
275
  (v: Vector3): (m: Matrix3x3) => Vector3;
253
276
  };
254
- declare const solveSystem: {
277
+ export declare const solveSystem: {
255
278
  /**
256
279
  * Solves a system of equations represented by a matrix and a vector.
257
280
  *
@@ -260,7 +283,7 @@ declare const solveSystem: {
260
283
  * import * as Matrix3x3 from 'curvy/matrix3x3'
261
284
  * import * as Vector3 from 'curvy/vector3'
262
285
  *
263
- * const m = Matrix3x3.matrix3x3(1, 2, 3, 4, 5, 6, 7, 8, 9)
286
+ * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
264
287
  * const v = Vector3.vector3(10, 11, 12)
265
288
  *
266
289
  * // Performs:
@@ -269,6 +292,7 @@ declare const solveSystem: {
269
292
  * // z = m20 * x + m21 * y + m22 * z
270
293
  * const result = Matrix3x3.solveSystem(m, v)
271
294
  * ```
295
+ * @since 1.0.0
272
296
  */
273
297
  (m: Matrix3x3, v: Vector3): Vector3;
274
298
  /**
@@ -279,7 +303,7 @@ declare const solveSystem: {
279
303
  * import * as Matrix3x3 from 'curvy/matrix3x3'
280
304
  * import * as Vector3 from 'curvy/vector3'
281
305
  *
282
- * const m = Matrix3x3.matrix3x3(1, 2, 3, 4, 5, 6, 7, 8, 9)
306
+ * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
283
307
  * const v = Vector3.vector3(10, 11, 12)
284
308
  *
285
309
  * // Performs:
@@ -288,6 +312,7 @@ declare const solveSystem: {
288
312
  * // z = m20 * x + m21 * y + m22 * z
289
313
  * const result = Matrix3x3.solveSystem(v)(m)
290
314
  * ```
315
+ * @since 1.0.0
291
316
  */
292
317
  (v: Vector3): (m: Matrix3x3) => Vector3;
293
318
  };
@@ -298,7 +323,7 @@ declare const solveSystem: {
298
323
  * @returns An array of vectors representing the rows of the matrix.
299
324
  * @since 1.0.0
300
325
  */
301
- declare const toRows: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
326
+ export declare const toRows: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
302
327
  /**
303
328
  * Returns the columns of a `Matrix3x3` as an array of vectors.
304
329
  *
@@ -306,14 +331,15 @@ declare const toRows: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
306
331
  * @returns An array of vectors representing the columns of the matrix.
307
332
  * @since 1.0.0
308
333
  */
309
- declare const toColumns: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
310
- declare const rowVector: {
334
+ export declare const toColumns: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
335
+ export declare const rowVector: {
311
336
  /**
312
337
  * Gets a row vector from the matrix.
313
338
  *
314
339
  * @param m - The matrix to get the row vector from.
315
340
  * @param row - The row index to get the vector from.
316
341
  * @returns The row vector at the specified index.
342
+ * @since 1.0.0
317
343
  */
318
344
  (m: Matrix3x3, row: Matrix3x3Coordinate): Vector3;
319
345
  /**
@@ -321,16 +347,18 @@ declare const rowVector: {
321
347
  *
322
348
  * @param row - The row index to get the vector from.
323
349
  * @returns A function that takes a matrix and returns the row vector at the specified index.
350
+ * @since 1.0.0
324
351
  */
325
352
  (row: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3;
326
353
  };
327
- declare const columnVector: {
354
+ export declare const columnVector: {
328
355
  /**
329
356
  * Gets a column vector from the matrix.
330
357
  *
331
358
  * @param m - The matrix to get the column vector from.
332
359
  * @param column - The column index to get the vector from.
333
360
  * @returns The column vector at the specified index.
361
+ * @since 1.0.0
334
362
  */
335
363
  (m: Matrix3x3, column: Matrix3x3Coordinate): Vector3;
336
364
  /**
@@ -338,6 +366,7 @@ declare const columnVector: {
338
366
  *
339
367
  * @param column - The column index to get the vector from.
340
368
  * @returns A function that takes a matrix and returns the column vector at the specified index.
369
+ * @since 1.0.0
341
370
  */
342
371
  (column: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3;
343
372
  };
@@ -348,7 +377,7 @@ declare const columnVector: {
348
377
  * @returns A new `Matrix3x3` instance that is the transpose of the input matrix.
349
378
  * @since 1.0.0
350
379
  */
351
- declare const transpose: (m: Matrix3x3) => Matrix3x3;
380
+ export declare const transpose: (m: Matrix3x3) => Matrix3x3;
352
381
  /**
353
382
  * Reverses the rows of a `Matrix3x3`.
354
383
  *
@@ -356,7 +385,7 @@ declare const transpose: (m: Matrix3x3) => Matrix3x3;
356
385
  * @returns A new `Matrix3x3` instance with the rows reversed.
357
386
  * @since 1.0.0
358
387
  */
359
- declare const reverseRows: (m: Matrix3x3) => Matrix3x3;
388
+ export declare const reverseRows: (m: Matrix3x3) => Matrix3x3;
360
389
  /**
361
390
  * Reverses the columns of a `Matrix3x3`.
362
391
  *
@@ -364,7 +393,4 @@ declare const reverseRows: (m: Matrix3x3) => Matrix3x3;
364
393
  * @returns A new `Matrix3x3` instance with the columns reversed.
365
394
  * @since 1.0.0
366
395
  */
367
- declare const reverseColumns: (m: Matrix3x3) => Matrix3x3;
368
-
369
- export { columnVector, determinant, fromColumns, fromRows, isMatrix3x3, matrix3x3, minor, reverseColumns, reverseRows, rowVector, setColumn, setRow, solveSystem, toColumns, toRows, transpose, vectorProductLeft, vectorProductRight };
370
- export type { Matrix3x3, Matrix3x3Coordinate };
396
+ export declare const reverseColumns: (m: Matrix3x3) => Matrix3x3;
@@ -0,0 +1,4 @@
1
+ import type { Matrix3x3 } from './matrix3x3.ts';
2
+ export declare const Matrix3x3TypeId: unique symbol;
3
+ export type Matrix3x3TypeId = typeof Matrix3x3TypeId;
4
+ export type { Matrix3x3 };