curvy 1.0.8 → 2.0.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/dist/characteristic/index.d.mts +88 -0
- package/dist/characteristic/index.mjs +2 -0
- package/dist/curve/index.d.mts +2 -0
- package/dist/curve/index.mjs +2 -0
- package/dist/interval/index.d.mts +2 -0
- package/dist/interval/index.mjs +2 -0
- package/dist/matrix/index.d.mts +2 -0
- package/dist/matrix/index.mjs +267 -0
- package/dist/matrix/index.mjs.map +1 -0
- package/dist/number.d.mts +280 -0
- package/dist/number.mjs +140 -0
- package/dist/number.mjs.map +1 -0
- package/dist/path/index.d.mts +241 -0
- package/dist/path/index.mjs +292 -0
- package/dist/path/index.mjs.map +1 -0
- package/dist/polynomial/index.d.mts +2 -0
- package/dist/polynomial/index.mjs +3 -0
- package/dist/shared/characteristic-BGRxcxUH.mjs +104 -0
- package/dist/shared/characteristic-BGRxcxUH.mjs.map +1 -0
- package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
- package/dist/shared/cubic-CYYEUHNm.mjs +479 -0
- package/dist/shared/cubic-CYYEUHNm.mjs.map +1 -0
- package/dist/shared/cubic-Dfn6DB02.d.mts +1099 -0
- package/dist/shared/interval-CCEqzPgA.mjs +376 -0
- package/dist/shared/interval-CCEqzPgA.mjs.map +1 -0
- package/dist/shared/interval-hQDiKqj0.d.mts +494 -0
- package/dist/shared/matrix4x4-Bt_DBlP0.d.mts +1182 -0
- package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
- package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
- package/dist/shared/quadratic-DEhuAKuE.mjs +330 -0
- package/dist/shared/quadratic-DEhuAKuE.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-BPLohNuI.d.mts +787 -0
- package/dist/shared/rationalCubic2d-CP4oGpnk.mjs +658 -0
- package/dist/shared/rationalCubic2d-CP4oGpnk.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-CXa7Yren.mjs +278 -0
- package/dist/shared/rationalCubic2d-CXa7Yren.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-D_-XWxcm.d.mts +297 -0
- package/dist/shared/solution-BjoW7ov4.d.mts +251 -0
- package/dist/shared/solution-CbSWzXCn.mjs +306 -0
- package/dist/shared/solution-CbSWzXCn.mjs.map +1 -0
- package/dist/{pipe.d.mts → shared/utils-DqTGyXrP.d.mts} +44 -26
- package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
- package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
- package/dist/shared/vector2-TV0UnlxY.d.mts +1168 -0
- package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
- package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
- package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
- package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
- package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
- package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
- package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
- package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
- package/dist/solution/index.d.mts +2 -0
- package/dist/solution/index.mjs +2 -0
- package/dist/splines/index.d.mts +701 -0
- package/dist/splines/index.mjs +734 -0
- package/dist/splines/index.mjs.map +1 -0
- package/dist/utils.d.mts +2 -27
- package/dist/utils.mjs +88 -43
- package/dist/utils.mjs.map +1 -0
- package/dist/vector/index.d.mts +2 -0
- package/dist/vector/index.mjs +4 -0
- package/package.json +49 -92
- package/dist/curve/cubic2d.d.mts +0 -31
- package/dist/curve/cubic2d.d.ts +0 -31
- package/dist/curve/cubic2d.mjs +0 -97
- package/dist/curve/linear2d.d.mts +0 -28
- package/dist/curve/linear2d.d.ts +0 -28
- package/dist/curve/linear2d.mjs +0 -49
- package/dist/curve/quadratic2d.d.mts +0 -33
- package/dist/curve/quadratic2d.d.ts +0 -33
- package/dist/curve/quadratic2d.mjs +0 -87
- package/dist/interval.d.mts +0 -58
- package/dist/interval.d.ts +0 -58
- package/dist/interval.mjs +0 -89
- package/dist/matrix/matrix2x2.d.mts +0 -49
- package/dist/matrix/matrix2x2.d.ts +0 -49
- package/dist/matrix/matrix2x2.mjs +0 -24
- package/dist/matrix/matrix3x3.d.mts +0 -63
- package/dist/matrix/matrix3x3.d.ts +0 -63
- package/dist/matrix/matrix3x3.mjs +0 -27
- package/dist/matrix/matrix4x4.d.mts +0 -72
- package/dist/matrix/matrix4x4.d.ts +0 -72
- package/dist/matrix/matrix4x4.mjs +0 -215
- package/dist/path/cubic2d.d.mts +0 -29
- package/dist/path/cubic2d.d.ts +0 -29
- package/dist/path/cubic2d.mjs +0 -62
- package/dist/path/linear2d.d.mts +0 -29
- package/dist/path/linear2d.d.ts +0 -29
- package/dist/path/linear2d.mjs +0 -55
- package/dist/path/quadratic2d.d.mts +0 -30
- package/dist/path/quadratic2d.d.ts +0 -30
- package/dist/path/quadratic2d.mjs +0 -61
- package/dist/pipe.d.ts +0 -58
- package/dist/pipe.mjs +0 -91
- package/dist/polynomial/cubic.d.mts +0 -7
- package/dist/polynomial/cubic.d.ts +0 -7
- package/dist/polynomial/cubic.mjs +0 -148
- package/dist/polynomial/linear.d.mts +0 -7
- package/dist/polynomial/linear.d.ts +0 -7
- package/dist/polynomial/linear.mjs +0 -23
- package/dist/polynomial/quadratic.d.mts +0 -7
- package/dist/polynomial/quadratic.d.ts +0 -7
- package/dist/polynomial/quadratic.mjs +0 -24
- package/dist/shared/curvy.BDhiZ7He.mjs +0 -80
- package/dist/shared/curvy.BZ_mTkJe.mjs +0 -60
- package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
- package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
- package/dist/shared/curvy.BsHoYJNv.d.ts +0 -155
- package/dist/shared/curvy.BzVmUIKm.mjs +0 -131
- package/dist/shared/curvy.C2XGH0R0.mjs +0 -75
- package/dist/shared/curvy.CE4X6_Is.mjs +0 -181
- package/dist/shared/curvy.Cps2R_RU.mjs +0 -120
- package/dist/shared/curvy.Cv-wIzDr.mjs +0 -124
- package/dist/shared/curvy.DmVFTi0N.mjs +0 -34
- package/dist/shared/curvy.NsmY7zcr.d.mts +0 -155
- package/dist/shared/curvy.wYJQhFW-.mjs +0 -87
- package/dist/splines/basis2d.d.mts +0 -38
- package/dist/splines/basis2d.d.ts +0 -38
- package/dist/splines/basis2d.mjs +0 -89
- package/dist/splines/bezier2d.d.mts +0 -48
- package/dist/splines/bezier2d.d.ts +0 -48
- package/dist/splines/bezier2d.mjs +0 -22
- package/dist/splines/cardinal2d.d.mts +0 -49
- package/dist/splines/cardinal2d.d.ts +0 -49
- package/dist/splines/cardinal2d.mjs +0 -123
- package/dist/splines/hermite2d.d.mts +0 -33
- package/dist/splines/hermite2d.d.ts +0 -33
- package/dist/splines/hermite2d.mjs +0 -77
- package/dist/utils.d.ts +0 -27
- package/dist/vector/vector2.d.mts +0 -66
- package/dist/vector/vector2.d.ts +0 -66
- package/dist/vector/vector2.mjs +0 -28
- package/dist/vector/vector3.d.mts +0 -77
- package/dist/vector/vector3.d.ts +0 -77
- package/dist/vector/vector3.mjs +0 -32
- package/dist/vector/vector4.d.mts +0 -43
- package/dist/vector/vector4.d.ts +0 -43
- package/dist/vector/vector4.mjs +0 -18
|
@@ -0,0 +1,1182 @@
|
|
|
1
|
+
import { c as FourDimensionalComponent, d as ThreeDimensionalIndex, i as Vector3, l as FourDimensionalIndex, m as TwoDimensionalIndex, o as Vector4, p as TwoDimensionalComponent, t as Vector2, u as ThreeDimensionalComponent } from "./vector2-TV0UnlxY.mjs";
|
|
2
|
+
import { t as Pipeable } from "./utils-DqTGyXrP.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/matrix/matrix2x2.internal.d.ts
|
|
5
|
+
declare const Matrix2x2TypeId: unique symbol;
|
|
6
|
+
type Matrix2x2TypeId = typeof Matrix2x2TypeId;
|
|
7
|
+
declare namespace matrix2x2_d_exports {
|
|
8
|
+
export { Matrix2x2, Matrix2x2Coordinate, columnVector$2 as columnVector, determinant$2 as determinant, equals$2 as equals, fromColumns$2 as fromColumns, fromRows$2 as fromRows, isMatrix2x2, make$2 as make, reverseColumns$2 as reverseColumns, reverseRows$2 as reverseRows, rowVector$2 as rowVector, setColumn$2 as setColumn, setRow$2 as setRow, solveSystem$2 as solveSystem, toColumns$2 as toColumns, toRows$2 as toRows, transpose$2 as transpose, vectorProductLeft$2 as vectorProductLeft, vectorProductRight$2 as vectorProductRight };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A type representing the coordinate of a 2D matrix.
|
|
12
|
+
*
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
*/
|
|
15
|
+
type Matrix2x2Coordinate = TwoDimensionalIndex | TwoDimensionalComponent;
|
|
16
|
+
/**
|
|
17
|
+
* A 2D matrix with 2 rows and 2 columns.
|
|
18
|
+
*
|
|
19
|
+
* All fields are readonly and immutable, and all operations create new instances.
|
|
20
|
+
*
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
*/
|
|
23
|
+
interface Matrix2x2 extends Pipeable {
|
|
24
|
+
readonly [Matrix2x2TypeId]: Matrix2x2TypeId;
|
|
25
|
+
/**
|
|
26
|
+
* The value in the first row and first column.
|
|
27
|
+
*/
|
|
28
|
+
readonly m00: number;
|
|
29
|
+
/**
|
|
30
|
+
* The value in the first row and second column.
|
|
31
|
+
*/
|
|
32
|
+
readonly m01: number;
|
|
33
|
+
/**
|
|
34
|
+
* The value in the second row and first column.
|
|
35
|
+
*/
|
|
36
|
+
readonly m10: number;
|
|
37
|
+
/**
|
|
38
|
+
* The value in the second row and second column.
|
|
39
|
+
*/
|
|
40
|
+
readonly m11: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a value is a `Matrix2x2`.
|
|
44
|
+
*
|
|
45
|
+
* @param m - The value to check.
|
|
46
|
+
* @returns `true` if the value is a `Matrix2x2`, `false` otherwise.
|
|
47
|
+
* @since 1.0.0
|
|
48
|
+
*/
|
|
49
|
+
declare const isMatrix2x2: (m: unknown) => m is Matrix2x2;
|
|
50
|
+
declare const equals$2: {
|
|
51
|
+
/**
|
|
52
|
+
* Checks if two `Matrix2x2` instances are approximately equal within the
|
|
53
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
54
|
+
*
|
|
55
|
+
* @param a - The first matrix.
|
|
56
|
+
* @param b - The second matrix.
|
|
57
|
+
* @returns `true` when each pair of components is within tolerance.
|
|
58
|
+
* @since 1.1.0
|
|
59
|
+
*/
|
|
60
|
+
(a: Matrix2x2, b: Matrix2x2): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if two `Matrix2x2` instances are approximately equal within the
|
|
63
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
64
|
+
*
|
|
65
|
+
* @param b - The second matrix.
|
|
66
|
+
* @returns A function that takes the first matrix and returns the comparison result.
|
|
67
|
+
* @since 1.1.0
|
|
68
|
+
*/
|
|
69
|
+
(b: Matrix2x2): (a: Matrix2x2) => boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Creates a new `Matrix2x2` instance.
|
|
73
|
+
*
|
|
74
|
+
* @param m00 - The value in the first row and first column. Defaults to 0.
|
|
75
|
+
* @param m01 - The value in the first row and second column. Defaults to 0.
|
|
76
|
+
* @param m10 - The value in the second row and first column. Defaults to 0.
|
|
77
|
+
* @param m11 - The value in the second row and second column. Defaults to 0.
|
|
78
|
+
*/
|
|
79
|
+
declare const make$2: (m00?: number, m01?: number, m10?: number, m11?: number) => Matrix2x2;
|
|
80
|
+
/**
|
|
81
|
+
* Creates a new `Matrix2x2` instance from two vectors representing rows.
|
|
82
|
+
*
|
|
83
|
+
* @param v0 - The first row vector.
|
|
84
|
+
* @param v1 - The second row vector.
|
|
85
|
+
* @returns A new `Matrix2x2` instance.
|
|
86
|
+
* @since 1.0.0
|
|
87
|
+
*/
|
|
88
|
+
declare const fromRows$2: (v0: Vector2, v1: Vector2) => Matrix2x2;
|
|
89
|
+
/**
|
|
90
|
+
* Creates a new `Matrix2x2` instance from two vectors representing columns.
|
|
91
|
+
*
|
|
92
|
+
* @param v0 - The first column vector.
|
|
93
|
+
* @param v1 - The second column vector.
|
|
94
|
+
* @returns A new `Matrix2x2` instance.
|
|
95
|
+
* @since 1.0.0
|
|
96
|
+
*/
|
|
97
|
+
declare const fromColumns$2: (v0: Vector2, v1: Vector2) => Matrix2x2;
|
|
98
|
+
declare const setRow$2: {
|
|
99
|
+
/**
|
|
100
|
+
* Sets the specified row of the matrix to the given vector.
|
|
101
|
+
*
|
|
102
|
+
* @param m - The matrix to modify.
|
|
103
|
+
* @param row - The row index (0 or 1).
|
|
104
|
+
* @param v - The vector to set the row to.
|
|
105
|
+
* @returns A new `Matrix2x2` instance with the specified row set to the given vector.
|
|
106
|
+
* @since 1.0.0
|
|
107
|
+
*/
|
|
108
|
+
(m: Matrix2x2, row: Matrix2x2Coordinate, v: Vector2): Matrix2x2;
|
|
109
|
+
/**
|
|
110
|
+
* Sets the specified row of the matrix to the given vector.
|
|
111
|
+
*
|
|
112
|
+
* @param row - The row index (0 or 1).
|
|
113
|
+
* @param v - The vector to set the row to.
|
|
114
|
+
* @returns A function that takes a matrix and returns a new `Matrix2x2` instance with the specified row set to the given vector.
|
|
115
|
+
* @since 1.0.0
|
|
116
|
+
*/
|
|
117
|
+
(row: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2;
|
|
118
|
+
};
|
|
119
|
+
declare const setColumn$2: {
|
|
120
|
+
/**
|
|
121
|
+
* Sets the specified column of the matrix to the given vector.
|
|
122
|
+
*
|
|
123
|
+
* @param m - The matrix to modify.
|
|
124
|
+
* @param column - The column index (0 or 1).
|
|
125
|
+
* @param v - The vector to set the column to.
|
|
126
|
+
* @returns A new `Matrix2x2` instance with the specified column set to the given vector.
|
|
127
|
+
* @since 1.0.0
|
|
128
|
+
*/
|
|
129
|
+
(m: Matrix2x2, column: Matrix2x2Coordinate, v: Vector2): Matrix2x2;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the specified column of the matrix to the given vector.
|
|
132
|
+
*
|
|
133
|
+
* @param column - The column index (0 or 1).
|
|
134
|
+
* @param v - The vector to set the column to.
|
|
135
|
+
* @returns A function that takes a matrix and returns a new `Matrix2x2` instance with the specified column set to the given vector.
|
|
136
|
+
* @since 1.0.0
|
|
137
|
+
*/
|
|
138
|
+
(column: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Calculates the determinant of a 2D matrix.
|
|
142
|
+
*
|
|
143
|
+
* @param m - The matrix to calculate the determinant for.
|
|
144
|
+
* @returns The determinant of the matrix.
|
|
145
|
+
* @since 1.0.0
|
|
146
|
+
*/
|
|
147
|
+
declare const determinant$2: (m: Matrix2x2) => number;
|
|
148
|
+
declare const vectorProductLeft$2: {
|
|
149
|
+
/**
|
|
150
|
+
* Calculates the left vector product of a matrix and a vector.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* import * as Matrix2x2 from 'curvy/matrix2x2'
|
|
155
|
+
* import * as Vector2 from 'curvy/vector2'
|
|
156
|
+
*
|
|
157
|
+
* const matrix = Matrix2x2.make(1, 2, 3, 4)
|
|
158
|
+
* const vector = Vector2.make(5, 6)
|
|
159
|
+
*
|
|
160
|
+
* // Performs:
|
|
161
|
+
* // x = 1 * 5 + 2 * 6 = 17
|
|
162
|
+
* // y = 3 * 5 + 4 * 6 = 39
|
|
163
|
+
* const result = Matrix2x2.vectorProductLeft(matrix, vector)
|
|
164
|
+
* ```
|
|
165
|
+
* @param m - The matrix to multiply.
|
|
166
|
+
* @param v - The vector to multiply.
|
|
167
|
+
* @returns The resulting vector after the left vector product.
|
|
168
|
+
* @since 1.0.0
|
|
169
|
+
*/
|
|
170
|
+
(m: Matrix2x2, v: Vector2): Vector2;
|
|
171
|
+
/**
|
|
172
|
+
* Calculates the left vector product of a matrix and a vector.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import * as Matrix2x2 from 'curvy/matrix2x2'
|
|
177
|
+
* import * as Vector2 from 'curvy/vector2'
|
|
178
|
+
*
|
|
179
|
+
* const matrix = Matrix2x2.make(1, 2, 3, 4)
|
|
180
|
+
* const vector = Vector2.make(5, 6)
|
|
181
|
+
*
|
|
182
|
+
* // Performs:
|
|
183
|
+
* // x = 1 * 5 + 2 * 6 = 17
|
|
184
|
+
* // y = 3 * 5 + 4 * 6 = 39
|
|
185
|
+
* const result = Matrix2x2.vectorProductLeft(vector)(matrix)
|
|
186
|
+
* ```
|
|
187
|
+
* @param v - The vector to multiply.
|
|
188
|
+
* @returns A function that takes a matrix and returns the resulting vector after the left vector product.
|
|
189
|
+
* @since 1.0.0
|
|
190
|
+
*/
|
|
191
|
+
(v: Vector2): (m: Matrix2x2) => Vector2;
|
|
192
|
+
};
|
|
193
|
+
declare const vectorProductRight$2: {
|
|
194
|
+
/**
|
|
195
|
+
* Calculates the right vector product of a matrix and a vector.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* import * as Matrix2x2 from 'curvy/matrix2x2'
|
|
200
|
+
* import * as Vector2 from 'curvy/vector2'
|
|
201
|
+
*
|
|
202
|
+
* const matrix = Matrix2x2.make(1, 2, 3, 4)
|
|
203
|
+
* const vector = Vector2.make(5, 6)
|
|
204
|
+
*
|
|
205
|
+
* // Performs:
|
|
206
|
+
* // x = 1 * 5 + 3 * 6 = 33
|
|
207
|
+
* // y = 2 * 5 + 4 * 6 = 62
|
|
208
|
+
* const result = Matrix2x2.vectorProductRight(matrix, vector)
|
|
209
|
+
* ```
|
|
210
|
+
* @param m - The matrix to multiply.
|
|
211
|
+
* @param v - The vector to multiply.
|
|
212
|
+
* @returns The resulting vector after the right vector product.
|
|
213
|
+
* @since 1.0.0
|
|
214
|
+
*/
|
|
215
|
+
(m: Matrix2x2, v: Vector2): Vector2;
|
|
216
|
+
/**
|
|
217
|
+
* Calculates the right vector product of a matrix and a vector.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* import * as Matrix2x2 from 'curvy/matrix2x2'
|
|
222
|
+
* import * as Vector2 from 'curvy/vector2'
|
|
223
|
+
*
|
|
224
|
+
* const matrix = Matrix2x2.make(1, 2, 3, 4)
|
|
225
|
+
* const vector = Vector2.make(5, 6)
|
|
226
|
+
*
|
|
227
|
+
* // Performs:
|
|
228
|
+
* // x = 1 * 5 + 3 * 6 = 33
|
|
229
|
+
* // y = 2 * 5 + 4 * 6 = 62
|
|
230
|
+
* const result = Matrix2x2.vectorProductRight(vector)(matrix)
|
|
231
|
+
* ```
|
|
232
|
+
* @param v - The vector to multiply.
|
|
233
|
+
* @returns A function that takes a matrix and returns the resulting vector after the right vector product.
|
|
234
|
+
* @since 1.0.0
|
|
235
|
+
*/
|
|
236
|
+
(v: Vector2): (m: Matrix2x2) => Vector2;
|
|
237
|
+
};
|
|
238
|
+
declare const solveSystem$2: {
|
|
239
|
+
/**
|
|
240
|
+
* Solves a system of linear equations represented by a matrix and a vector.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* import * as Matrix2x2 from 'curvy/matrix2x2'
|
|
245
|
+
* import * as Vector2 from 'curvy/vector2'
|
|
246
|
+
*
|
|
247
|
+
* const matrix = Matrix2x2.make(1, 2, 3, 4)
|
|
248
|
+
* const vector = Vector2.make(5, 6)
|
|
249
|
+
*
|
|
250
|
+
* // Solves the system of equations:
|
|
251
|
+
* // 1x + 2y = 5
|
|
252
|
+
* // 3x + 4y = 6
|
|
253
|
+
* const result = Matrix2x2.solveSystem(matrix, vector)
|
|
254
|
+
* ```
|
|
255
|
+
* @param m - The matrix representing the coefficients of the system.
|
|
256
|
+
* @param v - The vector representing the constants of the system.
|
|
257
|
+
* @returns The solution vector.
|
|
258
|
+
* @since 1.0.0
|
|
259
|
+
*/
|
|
260
|
+
(m: Matrix2x2, v: Vector2): Vector2;
|
|
261
|
+
/**
|
|
262
|
+
* Solves a system of linear equations represented by a matrix and a vector.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* import * as Matrix2x2 from 'curvy/matrix2x2'
|
|
267
|
+
* import * as Vector2 from 'curvy/vector2'
|
|
268
|
+
*
|
|
269
|
+
* const matrix = Matrix2x2.make(1, 2, 3, 4)
|
|
270
|
+
* const vector = Vector2.make(5, 6)
|
|
271
|
+
*
|
|
272
|
+
* // Solves the system of equations:
|
|
273
|
+
* // 1x + 2y = 5
|
|
274
|
+
* // 3x + 4y = 6
|
|
275
|
+
* const result = Matrix2x2.solveSystem(vector)(matrix)
|
|
276
|
+
* ```
|
|
277
|
+
* @param v - The vector representing the constants of the system.
|
|
278
|
+
* @returns A function that takes a matrix and returns the solution vector.
|
|
279
|
+
* @since 1.0.0
|
|
280
|
+
*/
|
|
281
|
+
(v: Vector2): (m: Matrix2x2) => Vector2;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Returns the rows of a matrix as an array of vectors.
|
|
285
|
+
*
|
|
286
|
+
* @param m - The matrix to convert.
|
|
287
|
+
* @returns An array of vectors representing the rows of the matrix.
|
|
288
|
+
* @since 1.0.0
|
|
289
|
+
*/
|
|
290
|
+
declare const toRows$2: (m: Matrix2x2) => [Vector2, Vector2];
|
|
291
|
+
/**
|
|
292
|
+
* Returns the columns of a matrix as an array of vectors.
|
|
293
|
+
*
|
|
294
|
+
* @param m - The matrix to convert.
|
|
295
|
+
* @returns An array of vectors representing the columns of the matrix.
|
|
296
|
+
* @since 1.0.0
|
|
297
|
+
*/
|
|
298
|
+
declare const toColumns$2: (m: Matrix2x2) => [Vector2, Vector2];
|
|
299
|
+
/**
|
|
300
|
+
* Returns the specified row of a matrix as a vector.
|
|
301
|
+
*
|
|
302
|
+
* @param m - The matrix to get the row from.
|
|
303
|
+
* @param row - The row index (0 or 1).
|
|
304
|
+
* @returns A vector representing the specified row of the matrix.
|
|
305
|
+
* @since 1.0.0
|
|
306
|
+
*/
|
|
307
|
+
declare const rowVector$2: (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2;
|
|
308
|
+
/**
|
|
309
|
+
* Returns the specified column of a matrix as a vector.
|
|
310
|
+
*
|
|
311
|
+
* @param m - The matrix to get the column from.
|
|
312
|
+
* @param column - The column index (0 or 1).
|
|
313
|
+
* @returns A vector representing the specified column of the matrix.
|
|
314
|
+
* @since 1.0.0
|
|
315
|
+
*/
|
|
316
|
+
declare const columnVector$2: (m: Matrix2x2, column: Matrix2x2Coordinate) => Vector2;
|
|
317
|
+
/**
|
|
318
|
+
* Transposes a matrix.
|
|
319
|
+
*
|
|
320
|
+
* @param m - The matrix to transpose.
|
|
321
|
+
* @returns A new `Matrix2x2` instance representing the transposed matrix.
|
|
322
|
+
* @since 1.0.0
|
|
323
|
+
*/
|
|
324
|
+
declare const transpose$2: (m: Matrix2x2) => Matrix2x2;
|
|
325
|
+
/**
|
|
326
|
+
* Reverses the rows of a matrix.
|
|
327
|
+
*
|
|
328
|
+
* @param m - The matrix to reverse the rows of.
|
|
329
|
+
* @returns A new `Matrix2x2` instance with the rows reversed.
|
|
330
|
+
* @since 1.0.0
|
|
331
|
+
*/
|
|
332
|
+
declare const reverseRows$2: (m: Matrix2x2) => Matrix2x2;
|
|
333
|
+
/**
|
|
334
|
+
* Reverses the columns of a matrix.
|
|
335
|
+
*
|
|
336
|
+
* @param m - The matrix to reverse the columns of.
|
|
337
|
+
* @returns A new `Matrix2x2` instance with the columns reversed.
|
|
338
|
+
* @since 1.0.0
|
|
339
|
+
*/
|
|
340
|
+
declare const reverseColumns$2: (m: Matrix2x2) => Matrix2x2;
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/matrix/matrix3x3.internal.d.ts
|
|
343
|
+
declare const Matrix3x3TypeId: unique symbol;
|
|
344
|
+
type Matrix3x3TypeId = typeof Matrix3x3TypeId;
|
|
345
|
+
declare namespace matrix3x3_d_exports {
|
|
346
|
+
export { Matrix3x3, Matrix3x3Coordinate, columnVector$1 as columnVector, determinant$1 as determinant, equals$1 as equals, fromColumns$1 as fromColumns, fromRows$1 as fromRows, isMatrix3x3, make$1 as make, minor$1 as minor, reverseColumns$1 as reverseColumns, reverseRows$1 as reverseRows, rowVector$1 as rowVector, setColumn$1 as setColumn, setRow$1 as setRow, solveSystem$1 as solveSystem, toColumns$1 as toColumns, toRows$1 as toRows, transpose$1 as transpose, vectorProductLeft$1 as vectorProductLeft, vectorProductRight$1 as vectorProductRight };
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* A coordinate in a 3x3 matrix.
|
|
350
|
+
*
|
|
351
|
+
* @since 1.0.0
|
|
352
|
+
*/
|
|
353
|
+
type Matrix3x3Coordinate = ThreeDimensionalIndex | ThreeDimensionalComponent;
|
|
354
|
+
/**
|
|
355
|
+
* A 3x3 matrix.
|
|
356
|
+
*
|
|
357
|
+
* All fields are readonly and immutable, and all operations create new instances.
|
|
358
|
+
*
|
|
359
|
+
* @since 1.0.0
|
|
360
|
+
*/
|
|
361
|
+
interface Matrix3x3 extends Pipeable {
|
|
362
|
+
readonly [Matrix3x3TypeId]: Matrix3x3TypeId;
|
|
363
|
+
/**
|
|
364
|
+
* The value of the first row and first column.
|
|
365
|
+
*/
|
|
366
|
+
readonly m00: number;
|
|
367
|
+
/**
|
|
368
|
+
* The value of the first row and second column.
|
|
369
|
+
*/
|
|
370
|
+
readonly m01: number;
|
|
371
|
+
/**
|
|
372
|
+
* The value of the first row and third column.
|
|
373
|
+
*/
|
|
374
|
+
readonly m02: number;
|
|
375
|
+
/**
|
|
376
|
+
* The value of the second row and first column.
|
|
377
|
+
*/
|
|
378
|
+
readonly m10: number;
|
|
379
|
+
/**
|
|
380
|
+
* The value of the second row and second column.
|
|
381
|
+
*/
|
|
382
|
+
readonly m11: number;
|
|
383
|
+
/**
|
|
384
|
+
* The value of the second row and third column.
|
|
385
|
+
*/
|
|
386
|
+
readonly m12: number;
|
|
387
|
+
/**
|
|
388
|
+
* The value of the third row and first column.
|
|
389
|
+
*/
|
|
390
|
+
readonly m20: number;
|
|
391
|
+
/**
|
|
392
|
+
* The value of the third row and second column.
|
|
393
|
+
*/
|
|
394
|
+
readonly m21: number;
|
|
395
|
+
/**
|
|
396
|
+
* The value of the third row and third column.
|
|
397
|
+
*/
|
|
398
|
+
readonly m22: number;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Checks if a value is a `Matrix3x3`.
|
|
402
|
+
*
|
|
403
|
+
* @param m - The value to check.
|
|
404
|
+
* @returns `true` if the value is a `Matrix3x3`, `false` otherwise.
|
|
405
|
+
* @since 1.0.0
|
|
406
|
+
*/
|
|
407
|
+
declare const isMatrix3x3: (m: unknown) => m is Matrix3x3;
|
|
408
|
+
declare const equals$1: {
|
|
409
|
+
/**
|
|
410
|
+
* Checks if two `Matrix3x3` instances are approximately equal within the
|
|
411
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
412
|
+
*
|
|
413
|
+
* @param a - The first matrix.
|
|
414
|
+
* @param b - The second matrix.
|
|
415
|
+
* @returns `true` when each pair of components is within tolerance.
|
|
416
|
+
* @since 1.1.0
|
|
417
|
+
*/
|
|
418
|
+
(a: Matrix3x3, b: Matrix3x3): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Checks if two `Matrix3x3` instances are approximately equal within the
|
|
421
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
422
|
+
*
|
|
423
|
+
* @param b - The second matrix.
|
|
424
|
+
* @returns A function that takes the first matrix and returns the comparison result.
|
|
425
|
+
* @since 1.1.0
|
|
426
|
+
*/
|
|
427
|
+
(b: Matrix3x3): (a: Matrix3x3) => boolean;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* Creates a new `Matrix3x3` instance.
|
|
431
|
+
*
|
|
432
|
+
* @param m00 - The value of the first row and first column.
|
|
433
|
+
* @param m01 - The value of the first row and second column.
|
|
434
|
+
* @param m02 - The value of the first row and third column.
|
|
435
|
+
* @param m10 - The value of the second row and first column.
|
|
436
|
+
* @param m11 - The value of the second row and second column.
|
|
437
|
+
* @param m12 - The value of the second row and third column.
|
|
438
|
+
* @param m20 - The value of the third row and first column.
|
|
439
|
+
* @param m21 - The value of the third row and second column.
|
|
440
|
+
* @param m22 - The value of the third row and third column.
|
|
441
|
+
* @returns A new `Matrix3x3` instance.
|
|
442
|
+
* @since 1.0.0
|
|
443
|
+
*/
|
|
444
|
+
declare const make$1: (m00?: number, m01?: number, m02?: number, m10?: number, m11?: number, m12?: number, m20?: number, m21?: number, m22?: number) => Matrix3x3;
|
|
445
|
+
/**
|
|
446
|
+
* Creates a new `Matrix3x3` instance from three row vectors.
|
|
447
|
+
*
|
|
448
|
+
* @param v0 - The first row vector.
|
|
449
|
+
* @param v1 - The second row vector.
|
|
450
|
+
* @param v2 - The third row vector.
|
|
451
|
+
* @returns A new `Matrix3x3` instance.
|
|
452
|
+
* @since 1.0.0
|
|
453
|
+
*/
|
|
454
|
+
declare const fromRows$1: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
|
|
455
|
+
/**
|
|
456
|
+
* Creates a new `Matrix3x3` instance from three column vectors.
|
|
457
|
+
*
|
|
458
|
+
* @param v0 - The first column vector.
|
|
459
|
+
* @param v1 - The second column vector.
|
|
460
|
+
* @param v2 - The third column vector.
|
|
461
|
+
* @returns A new `Matrix3x3` instance.
|
|
462
|
+
* @since 1.0.0
|
|
463
|
+
*/
|
|
464
|
+
declare const fromColumns$1: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3;
|
|
465
|
+
declare const setRow$1: {
|
|
466
|
+
/**
|
|
467
|
+
* Sets a row of the matrix to a new vector.
|
|
468
|
+
*
|
|
469
|
+
* @param m - The matrix to set the row of.
|
|
470
|
+
* @param row - The row index to set.
|
|
471
|
+
* @param v - The new vector for the row.
|
|
472
|
+
* @returns A new matrix with the specified row set to the new vector.
|
|
473
|
+
* @since 1.0.0
|
|
474
|
+
*/
|
|
475
|
+
(m: Matrix3x3, row: Matrix3x3Coordinate, v: Vector3): Matrix3x3;
|
|
476
|
+
/**
|
|
477
|
+
* Sets a row of the matrix to a new vector.
|
|
478
|
+
*
|
|
479
|
+
* @param row - The row index to set.
|
|
480
|
+
* @param v - The new vector for the row.
|
|
481
|
+
* @returns A function that takes a matrix and returns a new matrix with the specified row set to the new vector.
|
|
482
|
+
* @since 1.0.0
|
|
483
|
+
*/
|
|
484
|
+
(row: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3;
|
|
485
|
+
};
|
|
486
|
+
declare const setColumn$1: {
|
|
487
|
+
/**
|
|
488
|
+
* Sets a column of the matrix to a new vector.
|
|
489
|
+
*
|
|
490
|
+
* @param m - The matrix to set the column of.
|
|
491
|
+
* @param column - The column index to set.
|
|
492
|
+
* @param v - The new vector for the column.
|
|
493
|
+
* @returns A new matrix with the specified column set to the new vector.
|
|
494
|
+
* @since 1.0.0
|
|
495
|
+
*/
|
|
496
|
+
(m: Matrix3x3, column: Matrix3x3Coordinate, v: Vector3): Matrix3x3;
|
|
497
|
+
/**
|
|
498
|
+
* Sets a column of the matrix to a new vector.
|
|
499
|
+
*
|
|
500
|
+
* @param column - The column index to set.
|
|
501
|
+
* @param v - The new vector for the column.
|
|
502
|
+
* @returns A function that takes a matrix and returns a new matrix with the specified column set to the new vector.
|
|
503
|
+
* @since 1.0.0
|
|
504
|
+
*/
|
|
505
|
+
(column: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3;
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* Calculates the determinant of a 3x3 matrix.
|
|
509
|
+
*
|
|
510
|
+
* @param m - The matrix to calculate the determinant of.
|
|
511
|
+
* @returns The determinant of the matrix.
|
|
512
|
+
* @since 1.0.0
|
|
513
|
+
*/
|
|
514
|
+
declare const determinant$1: (m: Matrix3x3) => number;
|
|
515
|
+
/**
|
|
516
|
+
* Calculates the minor of a 3x3 matrix.
|
|
517
|
+
*
|
|
518
|
+
* @param m - The matrix to calculate the minor of.
|
|
519
|
+
* @param row - The row index of the element to calculate the minor for.
|
|
520
|
+
* @param column - The column index of the element to calculate the minor for.
|
|
521
|
+
* @returns The minor of the matrix at the specified row and column.
|
|
522
|
+
* @since 1.0.0
|
|
523
|
+
*/
|
|
524
|
+
declare const minor$1: (m: Matrix3x3, row: Matrix3x3Coordinate, column: Matrix3x3Coordinate) => Matrix2x2;
|
|
525
|
+
declare const vectorProductLeft$1: {
|
|
526
|
+
/**
|
|
527
|
+
* Calculates the left vector product of a matrix and a vector.
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```ts
|
|
531
|
+
* import * as Matrix3x3 from 'curvy/matrix3x3'
|
|
532
|
+
* import * as Vector3 from 'curvy/vector3'
|
|
533
|
+
*
|
|
534
|
+
* const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
535
|
+
* const v = Vector3.vector3(10, 11, 12)
|
|
536
|
+
*
|
|
537
|
+
* // Performs:
|
|
538
|
+
* // x = 1 * 10 + 2 * 11 + 3 * 12
|
|
539
|
+
* // y = 4 * 10 + 5 * 11 + 6 * 12
|
|
540
|
+
* // z = 7 * 10 + 8 * 11 + 9 * 12
|
|
541
|
+
* const result = Matrix3x3.vectorProductLeft(m, v)
|
|
542
|
+
* ```
|
|
543
|
+
* @param m - The matrix to calculate the left vector product with.
|
|
544
|
+
* @param v - The vector to calculate the left vector product with.
|
|
545
|
+
* @returns The resulting vector from the left vector product.
|
|
546
|
+
* @since 1.0.0
|
|
547
|
+
*/
|
|
548
|
+
(m: Matrix3x3, v: Vector3): Vector3;
|
|
549
|
+
/**
|
|
550
|
+
* Calculates the left vector product of a matrix and a vector.
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* ```ts
|
|
554
|
+
* import * as Matrix3x3 from 'curvy/matrix3x3'
|
|
555
|
+
* import * as Vector3 from 'curvy/vector3'
|
|
556
|
+
*
|
|
557
|
+
* const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
558
|
+
* const v = Vector3.vector3(10, 11, 12)
|
|
559
|
+
*
|
|
560
|
+
* // Performs:
|
|
561
|
+
* // x = 1 * 10 + 2 * 11 + 3 * 12
|
|
562
|
+
* // y = 4 * 10 + 5 * 11 + 6 * 12
|
|
563
|
+
* // z = 7 * 10 + 8 * 11 + 9 * 12
|
|
564
|
+
* const result = Matrix3x3.vectorProductLeft(v)(m)
|
|
565
|
+
* ```
|
|
566
|
+
* @param v - The vector to calculate the left vector product with.
|
|
567
|
+
* @returns A function that takes a matrix and returns the resulting vector from the left vector product.
|
|
568
|
+
* @since 1.0.0
|
|
569
|
+
*/
|
|
570
|
+
(v: Vector3): (m: Matrix3x3) => Vector3;
|
|
571
|
+
};
|
|
572
|
+
declare const vectorProductRight$1: {
|
|
573
|
+
/**
|
|
574
|
+
* Calculates the right vector product of a matrix and a vector.
|
|
575
|
+
*
|
|
576
|
+
* @example
|
|
577
|
+
* ```ts
|
|
578
|
+
* import * as Matrix3x3 from 'curvy/matrix3x3'
|
|
579
|
+
* import * as Vector3 from 'curvy/vector3'
|
|
580
|
+
*
|
|
581
|
+
* const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
582
|
+
* const v = Vector3.vector3(10, 11, 12)
|
|
583
|
+
*
|
|
584
|
+
* // Performs:
|
|
585
|
+
* // x = 1 * 10 + 4 * 11 + 7 * 12
|
|
586
|
+
* // y = 2 * 10 + 5 * 11 + 8 * 12
|
|
587
|
+
* // z = 3 * 10 + 6 * 11 + 9 * 12
|
|
588
|
+
* const result = Matrix3x3.vectorProductRight(m, v)
|
|
589
|
+
* ```
|
|
590
|
+
* @param m - The matrix to calculate the right vector product with.
|
|
591
|
+
* @param v - The vector to calculate the right vector product with.
|
|
592
|
+
* @returns The resulting vector from the right vector product.
|
|
593
|
+
* @since 1.0.0
|
|
594
|
+
*/
|
|
595
|
+
(m: Matrix3x3, v: Vector3): Vector3;
|
|
596
|
+
/**
|
|
597
|
+
* Calculates the right vector product of a matrix and a vector.
|
|
598
|
+
*
|
|
599
|
+
* @example
|
|
600
|
+
* ```ts
|
|
601
|
+
* import * as Matrix3x3 from 'curvy/matrix3x3'
|
|
602
|
+
* import * as Vector3 from 'curvy/vector3'
|
|
603
|
+
*
|
|
604
|
+
* const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
605
|
+
* const v = Vector3.vector3(10, 11, 12)
|
|
606
|
+
*
|
|
607
|
+
* // Performs:
|
|
608
|
+
* // x = 1 * 10 + 4 * 11 + 7 * 12
|
|
609
|
+
* // y = 2 * 10 + 5 * 11 + 8 * 12
|
|
610
|
+
* // z = 3 * 10 + 6 * 11 + 9 * 12
|
|
611
|
+
* const result = Matrix3x3.vectorProductRight(v)(m)
|
|
612
|
+
* ```
|
|
613
|
+
* @param v - The vector to calculate the right vector product with.
|
|
614
|
+
* @returns A function that takes a matrix and returns the resulting vector from the right vector product.
|
|
615
|
+
* @since 1.0.0
|
|
616
|
+
*/
|
|
617
|
+
(v: Vector3): (m: Matrix3x3) => Vector3;
|
|
618
|
+
};
|
|
619
|
+
declare const solveSystem$1: {
|
|
620
|
+
/**
|
|
621
|
+
* Solves a system of equations represented by a matrix and a vector.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```ts
|
|
625
|
+
* import * as Matrix3x3 from 'curvy/matrix3x3'
|
|
626
|
+
* import * as Vector3 from 'curvy/vector3'
|
|
627
|
+
*
|
|
628
|
+
* const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
629
|
+
* const v = Vector3.vector3(10, 11, 12)
|
|
630
|
+
*
|
|
631
|
+
* // Performs:
|
|
632
|
+
* // x = m00 * x + m01 * y + m02 * z
|
|
633
|
+
* // y = m10 * x + m11 * y + m12 * z
|
|
634
|
+
* // z = m20 * x + m21 * y + m22 * z
|
|
635
|
+
* const result = Matrix3x3.solveSystem(m, v)
|
|
636
|
+
* ```
|
|
637
|
+
* @since 1.0.0
|
|
638
|
+
*/
|
|
639
|
+
(m: Matrix3x3, v: Vector3): Vector3;
|
|
640
|
+
/**
|
|
641
|
+
* Solves a system of equations represented by a matrix and a vector.
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```ts
|
|
645
|
+
* import * as Matrix3x3 from 'curvy/matrix3x3'
|
|
646
|
+
* import * as Vector3 from 'curvy/vector3'
|
|
647
|
+
*
|
|
648
|
+
* const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
649
|
+
* const v = Vector3.vector3(10, 11, 12)
|
|
650
|
+
*
|
|
651
|
+
* // Performs:
|
|
652
|
+
* // x = m00 * x + m01 * y + m02 * z
|
|
653
|
+
* // y = m10 * x + m11 * y + m12 * z
|
|
654
|
+
* // z = m20 * x + m21 * y + m22 * z
|
|
655
|
+
* const result = Matrix3x3.solveSystem(v)(m)
|
|
656
|
+
* ```
|
|
657
|
+
* @since 1.0.0
|
|
658
|
+
*/
|
|
659
|
+
(v: Vector3): (m: Matrix3x3) => Vector3;
|
|
660
|
+
};
|
|
661
|
+
/**
|
|
662
|
+
* Returns the rows of a `Matrix3x3` as an array of vectors.
|
|
663
|
+
*
|
|
664
|
+
* @param m - The matrix to get the rows from.
|
|
665
|
+
* @returns An array of vectors representing the rows of the matrix.
|
|
666
|
+
* @since 1.0.0
|
|
667
|
+
*/
|
|
668
|
+
declare const toRows$1: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
|
|
669
|
+
/**
|
|
670
|
+
* Returns the columns of a `Matrix3x3` as an array of vectors.
|
|
671
|
+
*
|
|
672
|
+
* @param m - The matrix to get the columns from.
|
|
673
|
+
* @returns An array of vectors representing the columns of the matrix.
|
|
674
|
+
* @since 1.0.0
|
|
675
|
+
*/
|
|
676
|
+
declare const toColumns$1: (m: Matrix3x3) => [Vector3, Vector3, Vector3];
|
|
677
|
+
declare const rowVector$1: {
|
|
678
|
+
/**
|
|
679
|
+
* Gets a row vector from the matrix.
|
|
680
|
+
*
|
|
681
|
+
* @param m - The matrix to get the row vector from.
|
|
682
|
+
* @param row - The row index to get the vector from.
|
|
683
|
+
* @returns The row vector at the specified index.
|
|
684
|
+
* @since 1.0.0
|
|
685
|
+
*/
|
|
686
|
+
(m: Matrix3x3, row: Matrix3x3Coordinate): Vector3;
|
|
687
|
+
/**
|
|
688
|
+
* Gets a row vector from the matrix.
|
|
689
|
+
*
|
|
690
|
+
* @param row - The row index to get the vector from.
|
|
691
|
+
* @returns A function that takes a matrix and returns the row vector at the specified index.
|
|
692
|
+
* @since 1.0.0
|
|
693
|
+
*/
|
|
694
|
+
(row: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3;
|
|
695
|
+
};
|
|
696
|
+
declare const columnVector$1: {
|
|
697
|
+
/**
|
|
698
|
+
* Gets a column vector from the matrix.
|
|
699
|
+
*
|
|
700
|
+
* @param m - The matrix to get the column vector from.
|
|
701
|
+
* @param column - The column index to get the vector from.
|
|
702
|
+
* @returns The column vector at the specified index.
|
|
703
|
+
* @since 1.0.0
|
|
704
|
+
*/
|
|
705
|
+
(m: Matrix3x3, column: Matrix3x3Coordinate): Vector3;
|
|
706
|
+
/**
|
|
707
|
+
* Gets a column vector from the matrix.
|
|
708
|
+
*
|
|
709
|
+
* @param column - The column index to get the vector from.
|
|
710
|
+
* @returns A function that takes a matrix and returns the column vector at the specified index.
|
|
711
|
+
* @since 1.0.0
|
|
712
|
+
*/
|
|
713
|
+
(column: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3;
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Transposes a `Matrix3x3`.
|
|
717
|
+
*
|
|
718
|
+
* @param m - The matrix to transpose.
|
|
719
|
+
* @returns A new `Matrix3x3` instance that is the transpose of the input matrix.
|
|
720
|
+
* @since 1.0.0
|
|
721
|
+
*/
|
|
722
|
+
declare const transpose$1: (m: Matrix3x3) => Matrix3x3;
|
|
723
|
+
/**
|
|
724
|
+
* Reverses the rows of a `Matrix3x3`.
|
|
725
|
+
*
|
|
726
|
+
* @param m - The matrix to reverse the rows of.
|
|
727
|
+
* @returns A new `Matrix3x3` instance with the rows reversed.
|
|
728
|
+
* @since 1.0.0
|
|
729
|
+
*/
|
|
730
|
+
declare const reverseRows$1: (m: Matrix3x3) => Matrix3x3;
|
|
731
|
+
/**
|
|
732
|
+
* Reverses the columns of a `Matrix3x3`.
|
|
733
|
+
*
|
|
734
|
+
* @param m - The matrix to reverse the columns of.
|
|
735
|
+
* @returns A new `Matrix3x3` instance with the columns reversed.
|
|
736
|
+
* @since 1.0.0
|
|
737
|
+
*/
|
|
738
|
+
declare const reverseColumns$1: (m: Matrix3x3) => Matrix3x3;
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/matrix/matrix4x4.internal.d.ts
|
|
741
|
+
declare const Matrix4x4TypeId: unique symbol;
|
|
742
|
+
type Matrix4x4TypeId = typeof Matrix4x4TypeId;
|
|
743
|
+
declare namespace matrix4x4_d_exports {
|
|
744
|
+
export { Matrix4x4, Matrix4x4Coordinate, columnVector, determinant, equals, fromColumns, fromRows, identity, inverse, isMatrix4x4, make, minor, multiply, reverseColumns, reverseRows, rowVector, setColumn, setRow, solveSystem, toColumns, toRows, transpose, vectorProductLeft, vectorProductRight };
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* A coordinate in a 4x4 matrix.
|
|
748
|
+
*
|
|
749
|
+
* @since 1.0.0
|
|
750
|
+
*/
|
|
751
|
+
type Matrix4x4Coordinate = FourDimensionalIndex | FourDimensionalComponent;
|
|
752
|
+
/**
|
|
753
|
+
* A 4x4 matrix.
|
|
754
|
+
*
|
|
755
|
+
* All fields are readonly and immutable, and all operations create new instances.
|
|
756
|
+
*
|
|
757
|
+
* @since 1.0.0
|
|
758
|
+
*/
|
|
759
|
+
interface Matrix4x4 extends Pipeable {
|
|
760
|
+
readonly [Matrix4x4TypeId]: Matrix4x4TypeId;
|
|
761
|
+
/**
|
|
762
|
+
* The value of the first row and first column.
|
|
763
|
+
*/
|
|
764
|
+
readonly m00: number;
|
|
765
|
+
/**
|
|
766
|
+
* The value of the first row and second column.
|
|
767
|
+
*/
|
|
768
|
+
readonly m01: number;
|
|
769
|
+
/**
|
|
770
|
+
* The value of the first row and third column.
|
|
771
|
+
*/
|
|
772
|
+
readonly m02: number;
|
|
773
|
+
/**
|
|
774
|
+
* The value of the first row and fourth column.
|
|
775
|
+
*/
|
|
776
|
+
readonly m03: number;
|
|
777
|
+
/**
|
|
778
|
+
* The value of the second row and first column.
|
|
779
|
+
*/
|
|
780
|
+
readonly m10: number;
|
|
781
|
+
/**
|
|
782
|
+
* The value of the second row and second column.
|
|
783
|
+
*/
|
|
784
|
+
readonly m11: number;
|
|
785
|
+
/**
|
|
786
|
+
* The value of the second row and third column.
|
|
787
|
+
*/
|
|
788
|
+
readonly m12: number;
|
|
789
|
+
/**
|
|
790
|
+
* The value of the second row and fourth column.
|
|
791
|
+
*/
|
|
792
|
+
readonly m13: number;
|
|
793
|
+
/**
|
|
794
|
+
* The value of the third row and first column.
|
|
795
|
+
*/
|
|
796
|
+
readonly m20: number;
|
|
797
|
+
/**
|
|
798
|
+
* The value of the third row and second column.
|
|
799
|
+
*/
|
|
800
|
+
readonly m21: number;
|
|
801
|
+
/**
|
|
802
|
+
* The value of the third row and third column.
|
|
803
|
+
*/
|
|
804
|
+
readonly m22: number;
|
|
805
|
+
/**
|
|
806
|
+
* The value of the third row and fourth column.
|
|
807
|
+
*/
|
|
808
|
+
readonly m23: number;
|
|
809
|
+
/**
|
|
810
|
+
* The value of the fourth row and first column.
|
|
811
|
+
*/
|
|
812
|
+
readonly m30: number;
|
|
813
|
+
/**
|
|
814
|
+
* The value of the fourth row and second column.
|
|
815
|
+
*/
|
|
816
|
+
readonly m31: number;
|
|
817
|
+
/**
|
|
818
|
+
* The value of the fourth row and third column.
|
|
819
|
+
*/
|
|
820
|
+
readonly m32: number;
|
|
821
|
+
/**
|
|
822
|
+
* The value of the fourth row and fourth column.
|
|
823
|
+
*/
|
|
824
|
+
readonly m33: number;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Checks if a value is a `Matrix4x4`.
|
|
828
|
+
*
|
|
829
|
+
* @param m - The value to check.
|
|
830
|
+
* @returns `true` if the value is a `Matrix4x4`, `false` otherwise.
|
|
831
|
+
* @since 1.0.0
|
|
832
|
+
*/
|
|
833
|
+
declare const isMatrix4x4: (m: unknown) => m is Matrix4x4;
|
|
834
|
+
/**
|
|
835
|
+
* The 4x4 identity matrix.
|
|
836
|
+
*
|
|
837
|
+
* @since 1.1.0
|
|
838
|
+
*/
|
|
839
|
+
declare const identity: Matrix4x4;
|
|
840
|
+
declare const equals: {
|
|
841
|
+
/**
|
|
842
|
+
* Checks if two `Matrix4x4` instances are approximately equal within the
|
|
843
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
844
|
+
*
|
|
845
|
+
* @param a - The first matrix.
|
|
846
|
+
* @param b - The second matrix.
|
|
847
|
+
* @returns `true` when each pair of components is within tolerance.
|
|
848
|
+
* @since 1.1.0
|
|
849
|
+
*/
|
|
850
|
+
(a: Matrix4x4, b: Matrix4x4): boolean;
|
|
851
|
+
/**
|
|
852
|
+
* Checks if two `Matrix4x4` instances are approximately equal within the
|
|
853
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
854
|
+
*
|
|
855
|
+
* @param b - The second matrix.
|
|
856
|
+
* @returns A function that takes the first matrix and returns the comparison result.
|
|
857
|
+
* @since 1.1.0
|
|
858
|
+
*/
|
|
859
|
+
(b: Matrix4x4): (a: Matrix4x4) => boolean;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* Creates a new `Matrix4x4` instance.
|
|
863
|
+
*
|
|
864
|
+
* @param m00 - The value of the first row and first column.
|
|
865
|
+
* @param m01 - The value of the first row and second column.
|
|
866
|
+
* @param m02 - The value of the first row and third column.
|
|
867
|
+
* @param m03 - The value of the first row and fourth column.
|
|
868
|
+
* @param m10 - The value of the second row and first column.
|
|
869
|
+
* @param m11 - The value of the second row and second column.
|
|
870
|
+
* @param m12 - The value of the second row and third column.
|
|
871
|
+
* @param m13 - The value of the second row and fourth column.
|
|
872
|
+
* @param m20 - The value of the third row and first column.
|
|
873
|
+
* @param m21 - The value of the third row and second column.
|
|
874
|
+
* @param m22 - The value of the third row and third column.
|
|
875
|
+
* @param m23 - The value of the third row and fourth column.
|
|
876
|
+
* @param m30 - The value of the fourth row and first column.
|
|
877
|
+
* @param m31 - The value of the fourth row and second column.
|
|
878
|
+
* @param m32 - The value of the fourth row and third column.
|
|
879
|
+
* @param m33 - The value of the fourth row and fourth column.
|
|
880
|
+
* @returns A new `Matrix4x4` instance.
|
|
881
|
+
* @since 1.0.0
|
|
882
|
+
*/
|
|
883
|
+
declare const make: (m00?: number, m01?: number, m02?: number, m03?: number, m10?: number, m11?: number, m12?: number, m13?: number, m20?: number, m21?: number, m22?: number, m23?: number, m30?: number, m31?: number, m32?: number, m33?: number) => Matrix4x4;
|
|
884
|
+
/**
|
|
885
|
+
* Creates a new `Matrix4x4` instance from four row vectors.
|
|
886
|
+
*
|
|
887
|
+
* @param v0 - The first row vector.
|
|
888
|
+
* @param v1 - The second row vector.
|
|
889
|
+
* @param v2 - The third row vector.
|
|
890
|
+
* @param v3 - The fourth row vector.
|
|
891
|
+
* @returns A new `Matrix4x4` instance.
|
|
892
|
+
* @since 1.0.0
|
|
893
|
+
*/
|
|
894
|
+
declare const fromRows: (v0: Vector4, v1: Vector4, v2: Vector4, v3: Vector4) => Matrix4x4;
|
|
895
|
+
/**
|
|
896
|
+
* Creates a new `Matrix4x4` instance from four column vectors.
|
|
897
|
+
*
|
|
898
|
+
* @param v0 - The first column vector.
|
|
899
|
+
* @param v1 - The second column vector.
|
|
900
|
+
* @param v2 - The third column vector.
|
|
901
|
+
* @param v3 - The fourth column vector.
|
|
902
|
+
*/
|
|
903
|
+
declare const fromColumns: (v0: Vector4, v1: Vector4, v2: Vector4, v3: Vector4) => Matrix4x4;
|
|
904
|
+
declare const setRow: {
|
|
905
|
+
/**
|
|
906
|
+
* Sets a row of a `Matrix4x4` to a new vector.
|
|
907
|
+
*
|
|
908
|
+
* @param m - The matrix to modify.
|
|
909
|
+
* @param row - The row to set.
|
|
910
|
+
* @param v - The new vector.
|
|
911
|
+
* @returns A new `Matrix4x4` instance with the specified row set to the new vector.
|
|
912
|
+
* @since 1.0.0
|
|
913
|
+
*/
|
|
914
|
+
(m: Matrix4x4, row: Matrix4x4Coordinate, v: Vector4): Matrix4x4;
|
|
915
|
+
/**
|
|
916
|
+
* Sets a row of a `Matrix4x4` to a new vector.
|
|
917
|
+
*
|
|
918
|
+
* @param row - The row to set.
|
|
919
|
+
* @param v - The new vector.
|
|
920
|
+
* @returns A function that takes a matrix and returns a new `Matrix4x4` instance with the specified row set to the new vector.
|
|
921
|
+
* @since 1.0.0
|
|
922
|
+
*/
|
|
923
|
+
(row: Matrix4x4Coordinate, v: Vector4): (m: Matrix4x4) => Matrix4x4;
|
|
924
|
+
};
|
|
925
|
+
declare const setColumn: {
|
|
926
|
+
/**
|
|
927
|
+
* Sets a column of a `Matrix4x4` to a new vector.
|
|
928
|
+
*
|
|
929
|
+
* @param m - The matrix to modify.
|
|
930
|
+
* @param column - The column to set.
|
|
931
|
+
* @param v - The new vector.
|
|
932
|
+
* @returns A new `Matrix4x4` instance with the specified column set to the new vector.
|
|
933
|
+
* @since 1.0.0
|
|
934
|
+
*/
|
|
935
|
+
(m: Matrix4x4, column: Matrix4x4Coordinate, v: Vector4): Matrix4x4;
|
|
936
|
+
/**
|
|
937
|
+
* Sets a column of a `Matrix4x4` to a new vector.
|
|
938
|
+
*
|
|
939
|
+
* @param column - The column to set.
|
|
940
|
+
* @param v - The new vector.
|
|
941
|
+
* @returns A function that takes a matrix and returns a new `Matrix4x4` instance with the specified column set to the new vector.
|
|
942
|
+
* @since 1.0.0
|
|
943
|
+
*/
|
|
944
|
+
(column: Matrix4x4Coordinate, v: Vector4): (m: Matrix4x4) => Matrix4x4;
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
* Calculates the determinant of a `Matrix4x4`.
|
|
948
|
+
*
|
|
949
|
+
* @param m - The matrix to calculate the determinant of.
|
|
950
|
+
* @returns The determinant of the matrix.
|
|
951
|
+
* @since 1.0.0
|
|
952
|
+
*/
|
|
953
|
+
declare const determinant: (m: Matrix4x4) => number;
|
|
954
|
+
/**
|
|
955
|
+
* Calculates the minor of a `Matrix4x4` at a given row and column.
|
|
956
|
+
*
|
|
957
|
+
* @param m - The matrix to calculate the minor of.
|
|
958
|
+
* @param row - The row to exclude.
|
|
959
|
+
* @param column - The column to exclude.
|
|
960
|
+
* @returns The minor of the matrix at the given row and column.
|
|
961
|
+
*/
|
|
962
|
+
declare const minor: (m: Matrix4x4, row: Matrix4x4Coordinate, column: Matrix4x4Coordinate) => Matrix3x3;
|
|
963
|
+
declare const vectorProductLeft: {
|
|
964
|
+
/**
|
|
965
|
+
* Calculates the left vector product of a `Matrix4x4` and a `Vector4`.
|
|
966
|
+
*
|
|
967
|
+
* @example
|
|
968
|
+
* ```ts
|
|
969
|
+
* import * as Matrix4x4 from 'curvy/matrix4x4'
|
|
970
|
+
* import * as Vector4 from 'curvy/vector4'
|
|
971
|
+
*
|
|
972
|
+
* const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
|
|
973
|
+
* const v = Vector4.make(17, 18, 19, 20)
|
|
974
|
+
*
|
|
975
|
+
* // Result:
|
|
976
|
+
* // x = 1 * 17 + 2 * 18 + 3 * 19 + 4 * 20
|
|
977
|
+
* // y = 5 * 17 + 6 * 18 + 7 * 19 + 8 * 20
|
|
978
|
+
* // z = 9 * 17 + 10 * 18 + 11 * 19 + 12 * 20
|
|
979
|
+
* // w = 13 * 17 + 14 * 18 + 15 * 19 + 16 * 20
|
|
980
|
+
* const result = Matrix4x4.vectorProductLeft(m, v)
|
|
981
|
+
* ```
|
|
982
|
+
* @param m - The matrix to multiply.
|
|
983
|
+
* @param v - The vector to multiply.
|
|
984
|
+
* @returns The resulting vector.
|
|
985
|
+
* @since 1.0.0
|
|
986
|
+
*/
|
|
987
|
+
(m: Matrix4x4, v: Vector4): Vector4;
|
|
988
|
+
/**
|
|
989
|
+
* Calculates the left vector product of a `Matrix4x4` and a `Vector4`.
|
|
990
|
+
*
|
|
991
|
+
* @example
|
|
992
|
+
* ```ts
|
|
993
|
+
* import * as Matrix4x4 from 'curvy/matrix4x4'
|
|
994
|
+
* import * as Vector4 from 'curvy/vector4'
|
|
995
|
+
*
|
|
996
|
+
* const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
|
|
997
|
+
* const v = Vector4.make(17, 18, 19, 20)
|
|
998
|
+
*
|
|
999
|
+
* // Result:
|
|
1000
|
+
* // x = 1 * 17 + 2 * 18 + 3 * 19 + 4 * 20
|
|
1001
|
+
* // y = 5 * 17 + 6 * 18 + 7 * 19 + 8 * 20
|
|
1002
|
+
* // z = 9 * 17 + 10 * 18 + 11 * 19 + 12 * 20
|
|
1003
|
+
* // w = 13 * 17 + 14 * 18 + 15 * 19 + 16 * 20
|
|
1004
|
+
* const result = Matrix4x4.vectorProductLeft(v)(m)
|
|
1005
|
+
* ```
|
|
1006
|
+
* @since 1.0.0
|
|
1007
|
+
*/
|
|
1008
|
+
(v: Vector4): (m: Matrix4x4) => Vector4;
|
|
1009
|
+
};
|
|
1010
|
+
declare const vectorProductRight: {
|
|
1011
|
+
/**
|
|
1012
|
+
* Calculates the right vector product of a `Matrix4x4` and a `Vector4`.
|
|
1013
|
+
*
|
|
1014
|
+
* @example
|
|
1015
|
+
* ```ts
|
|
1016
|
+
* import * as Matrix4x4 from 'curvy/matrix4x4'
|
|
1017
|
+
* import * as Vector4 from 'curvy/vector4'
|
|
1018
|
+
*
|
|
1019
|
+
* const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
|
|
1020
|
+
* const v = Vector4.make(17, 18, 19, 20)
|
|
1021
|
+
*
|
|
1022
|
+
* // Result:
|
|
1023
|
+
* // x = 1 * 17 + 5 * 18 + 9 * 19 + 13 * 20
|
|
1024
|
+
* // y = 2 * 17 + 6 * 18 + 10 * 19 + 14 * 20
|
|
1025
|
+
* // z = 3 * 17 + 7 * 18 + 11 * 19 + 15 * 20
|
|
1026
|
+
* // w = 4 * 17 + 8 * 18 + 12 * 19 + 16 * 20
|
|
1027
|
+
* const result = Matrix4x4.vectorProductRight(m, v)
|
|
1028
|
+
* ```
|
|
1029
|
+
* @since 1.0.0
|
|
1030
|
+
*/
|
|
1031
|
+
(m: Matrix4x4, v: Vector4): Vector4;
|
|
1032
|
+
/**
|
|
1033
|
+
* Calculates the right vector product of a `Matrix4x4` and a `Vector4`.
|
|
1034
|
+
*
|
|
1035
|
+
* @example
|
|
1036
|
+
* ```ts
|
|
1037
|
+
* import * as Matrix4x4 from 'curvy/matrix4x4'
|
|
1038
|
+
* import * as Vector4 from 'curvy/vector4'
|
|
1039
|
+
*
|
|
1040
|
+
* const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
|
|
1041
|
+
* const v = Vector4.make(17, 18, 19, 20)
|
|
1042
|
+
*
|
|
1043
|
+
* // Result:
|
|
1044
|
+
* // x = 1 * 17 + 5 * 18 + 9 * 19 + 13 * 20
|
|
1045
|
+
* // y = 2 * 17 + 6 * 18 + 10 * 19 + 14 * 20
|
|
1046
|
+
* // z = 3 * 17 + 7 * 18 + 11 * 19 + 15 * 20
|
|
1047
|
+
* // w = 4 * 17 + 8 * 18 + 12 * 19 + 16 * 20
|
|
1048
|
+
* const result = Matrix4x4.vectorProductRight(v)(m)
|
|
1049
|
+
* ```
|
|
1050
|
+
* @since 1.0.0
|
|
1051
|
+
*/
|
|
1052
|
+
(v: Vector4): (m: Matrix4x4) => Vector4;
|
|
1053
|
+
};
|
|
1054
|
+
declare const multiply: {
|
|
1055
|
+
/**
|
|
1056
|
+
* Multiplies two `Matrix4x4` instances. Result is `a · b`.
|
|
1057
|
+
*
|
|
1058
|
+
* @param a - The left-hand matrix.
|
|
1059
|
+
* @param b - The right-hand matrix.
|
|
1060
|
+
* @returns The product matrix.
|
|
1061
|
+
* @since 1.1.0
|
|
1062
|
+
*/
|
|
1063
|
+
(a: Matrix4x4, b: Matrix4x4): Matrix4x4;
|
|
1064
|
+
/**
|
|
1065
|
+
* Multiplies two `Matrix4x4` instances. Result is `a · b`.
|
|
1066
|
+
*
|
|
1067
|
+
* @param b - The right-hand matrix.
|
|
1068
|
+
* @returns A function that takes the left-hand matrix and returns the product.
|
|
1069
|
+
* @since 1.1.0
|
|
1070
|
+
*/
|
|
1071
|
+
(b: Matrix4x4): (a: Matrix4x4) => Matrix4x4;
|
|
1072
|
+
};
|
|
1073
|
+
/**
|
|
1074
|
+
* Returns the inverse of a `Matrix4x4`.
|
|
1075
|
+
*
|
|
1076
|
+
* Throws when the matrix is singular (determinant is zero).
|
|
1077
|
+
*
|
|
1078
|
+
* @param m - The matrix to invert.
|
|
1079
|
+
* @returns The inverse matrix.
|
|
1080
|
+
* @since 1.1.0
|
|
1081
|
+
*/
|
|
1082
|
+
declare const inverse: (m: Matrix4x4) => Matrix4x4;
|
|
1083
|
+
declare const solveSystem: {
|
|
1084
|
+
/**
|
|
1085
|
+
* Solves a system of linear equations represented by a `Matrix4x4` and a `Vector4`.
|
|
1086
|
+
*
|
|
1087
|
+
* @param m - The matrix representing the coefficients of the equations.
|
|
1088
|
+
* @param v - The vector representing the constants of the equations.
|
|
1089
|
+
* @returns The solution vector.
|
|
1090
|
+
* @since 1.0.0
|
|
1091
|
+
*/
|
|
1092
|
+
(m: Matrix4x4, v: Vector4): Vector4;
|
|
1093
|
+
/**
|
|
1094
|
+
* Solves a system of linear equations represented by a `Matrix4x4` and a `Vector4`.
|
|
1095
|
+
*
|
|
1096
|
+
* @param v - The vector representing the constants of the equations.
|
|
1097
|
+
* @returns A function that takes a matrix and returns the solution vector.
|
|
1098
|
+
* @since 1.0.0
|
|
1099
|
+
*/
|
|
1100
|
+
(v: Vector4): (m: Matrix4x4) => Vector4;
|
|
1101
|
+
};
|
|
1102
|
+
/**
|
|
1103
|
+
* Returns the rows of a `Matrix4x4` as an array of vectors.
|
|
1104
|
+
*
|
|
1105
|
+
* @param m - The matrix to convert.
|
|
1106
|
+
* @returns An array of vectors representing the rows of the matrix.
|
|
1107
|
+
* @since 1.0.0
|
|
1108
|
+
*/
|
|
1109
|
+
declare const toRows: (m: Matrix4x4) => [Vector4, Vector4, Vector4, Vector4];
|
|
1110
|
+
/**
|
|
1111
|
+
* Returns the columns of a `Matrix4x4` as an array of vectors.
|
|
1112
|
+
*
|
|
1113
|
+
* @param m - The matrix to convert.
|
|
1114
|
+
* @returns An array of vectors representing the columns of the matrix.
|
|
1115
|
+
* @since 1.0.0
|
|
1116
|
+
*/
|
|
1117
|
+
declare const toColumns: (m: Matrix4x4) => [Vector4, Vector4, Vector4, Vector4];
|
|
1118
|
+
declare const rowVector: {
|
|
1119
|
+
/**
|
|
1120
|
+
* Returns a row vector from a `Matrix4x4`.
|
|
1121
|
+
*
|
|
1122
|
+
* @param m - The matrix to get the row vector from.
|
|
1123
|
+
* @param row - The row index.
|
|
1124
|
+
* @returns The row vector.
|
|
1125
|
+
* @since 1.0.0
|
|
1126
|
+
*/
|
|
1127
|
+
(m: Matrix4x4, row: Matrix4x4Coordinate): Vector4;
|
|
1128
|
+
/**
|
|
1129
|
+
* Returns a row vector from a `Matrix4x4`.
|
|
1130
|
+
*
|
|
1131
|
+
* @param row - The row index.
|
|
1132
|
+
* @returns A function that takes a matrix and returns the row vector.
|
|
1133
|
+
* @since 1.0.0
|
|
1134
|
+
*/
|
|
1135
|
+
(row: Matrix4x4Coordinate): (m: Matrix4x4) => Vector4;
|
|
1136
|
+
};
|
|
1137
|
+
declare const columnVector: {
|
|
1138
|
+
/**
|
|
1139
|
+
* Returns a column vector from a `Matrix4x4`.
|
|
1140
|
+
*
|
|
1141
|
+
* @param m - The matrix to get the column vector from.
|
|
1142
|
+
* @param column - The column index.
|
|
1143
|
+
* @returns The column vector.
|
|
1144
|
+
* @since 1.0.0
|
|
1145
|
+
*/
|
|
1146
|
+
(m: Matrix4x4, column: Matrix4x4Coordinate): Vector4;
|
|
1147
|
+
/**
|
|
1148
|
+
* Returns a column vector from a `Matrix4x4`.
|
|
1149
|
+
*
|
|
1150
|
+
* @param column - The column index.
|
|
1151
|
+
* @returns A function that takes a matrix and returns the column vector.
|
|
1152
|
+
* @since 1.0.0
|
|
1153
|
+
*/
|
|
1154
|
+
(column: Matrix4x4Coordinate): (m: Matrix4x4) => Vector4;
|
|
1155
|
+
};
|
|
1156
|
+
/**
|
|
1157
|
+
* Transposes a `Matrix4x4`.
|
|
1158
|
+
*
|
|
1159
|
+
* @param m - The matrix to transpose.
|
|
1160
|
+
* @returns The transposed matrix.
|
|
1161
|
+
* @since 1.0.0
|
|
1162
|
+
*/
|
|
1163
|
+
declare const transpose: (m: Matrix4x4) => Matrix4x4;
|
|
1164
|
+
/**
|
|
1165
|
+
* Reverses the rows of a `Matrix4x4`.
|
|
1166
|
+
*
|
|
1167
|
+
* @param m - The matrix to reverse the rows of.
|
|
1168
|
+
* @returns The matrix with the rows reversed.
|
|
1169
|
+
* @since 1.0.0
|
|
1170
|
+
*/
|
|
1171
|
+
declare const reverseRows: (m: Matrix4x4) => Matrix4x4;
|
|
1172
|
+
/**
|
|
1173
|
+
* Reverses the columns of a `Matrix4x4`.
|
|
1174
|
+
*
|
|
1175
|
+
* @param m - The matrix to reverse the columns of.
|
|
1176
|
+
* @returns The matrix with the columns reversed.
|
|
1177
|
+
* @since 1.0.0
|
|
1178
|
+
*/
|
|
1179
|
+
declare const reverseColumns: (m: Matrix4x4) => Matrix4x4;
|
|
1180
|
+
//#endregion
|
|
1181
|
+
export { matrix2x2_d_exports as i, matrix4x4_d_exports as n, matrix3x3_d_exports as r, Matrix4x4 as t };
|
|
1182
|
+
//# sourceMappingURL=matrix4x4-Bt_DBlP0.d.mts.map
|