curvy 2.0.0-alpha.6 → 2.0.0-alpha.7

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 (145) hide show
  1. package/dist/characteristic/{index.d.mts → characteristic.d.ts} +9 -17
  2. package/dist/characteristic/index.d.ts +1 -0
  3. package/dist/characteristic/index.mjs +1 -1
  4. package/dist/curve/cubic2d.d.ts +215 -0
  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 +1 -1
  8. package/dist/curve/linear2d.d.ts +195 -0
  9. package/dist/curve/linear2d.internal.d.ts +2 -0
  10. package/dist/curve/quadratic2d.d.ts +223 -0
  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 +2 -2
  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 +1 -1
  24. package/dist/matrix/index.mjs.map +1 -1
  25. package/dist/matrix/matrix2x2.d.ts +335 -0
  26. package/dist/matrix/matrix2x2.internal.d.ts +2 -0
  27. package/dist/matrix/matrix3x3.d.ts +396 -0
  28. package/dist/matrix/matrix3x3.internal.d.ts +4 -0
  29. package/dist/matrix/matrix4x4.d.ts +439 -0
  30. package/dist/matrix/matrix4x4.internal.d.ts +2 -0
  31. package/dist/number.d.ts +276 -0
  32. package/dist/number.mjs.map +1 -1
  33. package/dist/path/cubic2d.d.ts +262 -0
  34. package/dist/path/cubic2d.internal.d.ts +2 -0
  35. package/dist/path/index.d.ts +12 -0
  36. package/dist/path/index.mjs +413 -4
  37. package/dist/path/index.mjs.map +1 -1
  38. package/dist/path/linear2d.d.ts +245 -0
  39. package/dist/path/linear2d.internal.d.ts +2 -0
  40. package/dist/path/quadratic2d.d.ts +234 -0
  41. package/dist/path/quadratic2d.internal.d.ts +2 -0
  42. package/dist/path/rationalCubic2d.d.ts +116 -0
  43. package/dist/path/rationalCubic2d.internal.d.ts +2 -0
  44. package/dist/path/traits.d.ts +95 -0
  45. package/dist/polynomial/cubic.d.ts +377 -0
  46. package/dist/polynomial/cubic.internal.circular.d.ts +2 -0
  47. package/dist/polynomial/cubic.internal.d.ts +1 -0
  48. package/dist/polynomial/index.d.ts +9 -0
  49. package/dist/polynomial/index.mjs +2 -2
  50. package/dist/polynomial/linear.d.ts +317 -0
  51. package/dist/polynomial/linear.internal.d.ts +2 -0
  52. package/dist/polynomial/monotonicity.d.ts +3 -0
  53. package/dist/polynomial/quadratic.d.ts +371 -0
  54. package/dist/polynomial/quadratic.internal.circular.d.ts +2 -0
  55. package/dist/polynomial/quadratic.internal.d.ts +1 -0
  56. package/dist/polynomial/traits.d.ts +56 -0
  57. package/dist/shared/{characteristic-DLlhja-I.mjs → characteristic-D9yZWCym.mjs} +3 -3
  58. package/dist/shared/characteristic-D9yZWCym.mjs.map +1 -0
  59. package/dist/shared/{cubic-CMonq6bg.mjs → cubic-BK8xjSkd.mjs} +79 -4
  60. package/dist/shared/cubic-BK8xjSkd.mjs.map +1 -0
  61. package/dist/shared/{interval-X1EYuf-T.mjs → interval-CqC3ZIqj.mjs} +40 -1
  62. package/dist/shared/interval-CqC3ZIqj.mjs.map +1 -0
  63. package/dist/shared/{interval2d-ca0J1NMr.mjs → interval2d-BMDmeL1M.mjs} +45 -4
  64. package/dist/shared/interval2d-BMDmeL1M.mjs.map +1 -0
  65. package/dist/shared/{matrix4x4-Ck2WROK-.mjs → matrix4x4-qyRufxfs.mjs} +62 -3
  66. package/dist/shared/matrix4x4-qyRufxfs.mjs.map +1 -0
  67. package/dist/shared/{quadratic-DyeMtvET.mjs → quadratic-CWXIRh42.mjs} +2 -2
  68. package/dist/shared/quadratic-CWXIRh42.mjs.map +1 -0
  69. package/dist/shared/{rationalCubic2d-Vw4qGPZj.mjs → rationalCubic2d-BZvT9s5N.mjs} +218 -5
  70. package/dist/shared/rationalCubic2d-BZvT9s5N.mjs.map +1 -0
  71. package/dist/shared/{rationalCubic2d-D658ltUM.mjs → rationalCubic2d-DaFTrUXw.mjs} +250 -36
  72. package/dist/shared/rationalCubic2d-DaFTrUXw.mjs.map +1 -0
  73. package/dist/shared/{solution-3TDATEMn.mjs → solution-UKGK826h.mjs} +22 -2
  74. package/dist/shared/solution-UKGK826h.mjs.map +1 -0
  75. package/dist/shared/{vector2-CCuJx1rX.mjs → vector2-CWU3cPB2.mjs} +12 -2
  76. package/dist/shared/vector2-CWU3cPB2.mjs.map +1 -0
  77. package/dist/shared/{vector2.internal-DU_E808S.mjs → vector2.internal-BL8hFl1c.mjs} +31 -2
  78. package/dist/shared/vector2.internal-BL8hFl1c.mjs.map +1 -0
  79. package/dist/shared/{vector3-C-qgKAjR.mjs → vector3-DmMm6pX8.mjs} +12 -2
  80. package/dist/shared/vector3-DmMm6pX8.mjs.map +1 -0
  81. package/dist/shared/{vector4-BhOKDhD5.mjs → vector4-oqPPp45j.mjs} +12 -2
  82. package/dist/shared/vector4-oqPPp45j.mjs.map +1 -0
  83. package/dist/shared/{vector4.internal-5XcaX12X.mjs → vector4.internal-BnnTjVIr.mjs} +45 -2
  84. package/dist/shared/vector4.internal-BnnTjVIr.mjs.map +1 -0
  85. package/dist/solution/index.d.ts +1 -0
  86. package/dist/solution/index.mjs +1 -1
  87. package/dist/{shared/solution-Cf_zoKFU.d.mts → solution/solution.d.ts} +64 -71
  88. package/dist/solution/solution.internal.d.ts +2 -0
  89. package/dist/splines/basis2d.d.ts +118 -0
  90. package/dist/splines/basis2d.internal.d.ts +2 -0
  91. package/dist/splines/bezier2d.d.ts +198 -0
  92. package/dist/splines/bezier2d.internal.d.ts +2 -0
  93. package/dist/splines/cardinal2d.d.ts +269 -0
  94. package/dist/splines/cardinal2d.internal.d.ts +2 -0
  95. package/dist/splines/hermite2d.d.ts +113 -0
  96. package/dist/splines/hermite2d.internal.d.ts +2 -0
  97. package/dist/splines/index.d.ts +15 -0
  98. package/dist/splines/index.mjs +62 -8
  99. package/dist/splines/index.mjs.map +1 -1
  100. package/dist/splines/rationalBezier2d.d.ts +144 -0
  101. package/dist/splines/rationalBezier2d.internal.d.ts +2 -0
  102. package/dist/splines/util.d.ts +5 -0
  103. package/dist/utils.d.ts +73 -0
  104. package/dist/vector/index.d.ts +9 -0
  105. package/dist/vector/index.mjs +3 -3
  106. package/dist/vector/vector2.d.ts +449 -0
  107. package/dist/vector/vector2.internal.d.ts +4 -0
  108. package/dist/vector/vector3.d.ts +454 -0
  109. package/dist/vector/vector3.internal.d.ts +2 -0
  110. package/dist/vector/vector4.d.ts +258 -0
  111. package/dist/vector/vector4.internal.d.ts +2 -0
  112. package/package.json +13 -13
  113. package/dist/curve/index.d.mts +0 -2
  114. package/dist/interval/index.d.mts +0 -3
  115. package/dist/matrix/index.d.mts +0 -2
  116. package/dist/number.d.mts +0 -280
  117. package/dist/path/index.d.mts +0 -261
  118. package/dist/polynomial/index.d.mts +0 -2
  119. package/dist/shared/characteristic-DLlhja-I.mjs.map +0 -1
  120. package/dist/shared/cubic-C3ZMAoGj.d.mts +0 -1124
  121. package/dist/shared/cubic-CMonq6bg.mjs.map +0 -1
  122. package/dist/shared/interval-CSntLeSX.d.mts +0 -533
  123. package/dist/shared/interval-X1EYuf-T.mjs.map +0 -1
  124. package/dist/shared/interval2d-D42_0ka1.d.mts +0 -172
  125. package/dist/shared/interval2d-ca0J1NMr.mjs.map +0 -1
  126. package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +0 -1
  127. package/dist/shared/matrix4x4-gy9ejrX2.d.mts +0 -1183
  128. package/dist/shared/quadratic-DyeMtvET.mjs.map +0 -1
  129. package/dist/shared/rationalCubic2d-C1RBShBF.d.mts +0 -818
  130. package/dist/shared/rationalCubic2d-D658ltUM.mjs.map +0 -1
  131. package/dist/shared/rationalCubic2d-DFFvp5S1.d.mts +0 -308
  132. package/dist/shared/rationalCubic2d-Vw4qGPZj.mjs.map +0 -1
  133. package/dist/shared/solution-3TDATEMn.mjs.map +0 -1
  134. package/dist/shared/utils-MCckigYk.d.mts +0 -76
  135. package/dist/shared/vector2-5GyA0jBj.d.mts +0 -470
  136. package/dist/shared/vector2-CCuJx1rX.mjs.map +0 -1
  137. package/dist/shared/vector2.internal-DU_E808S.mjs.map +0 -1
  138. package/dist/shared/vector3-BfOPFZEn.d.mts +0 -703
  139. package/dist/shared/vector3-C-qgKAjR.mjs.map +0 -1
  140. package/dist/shared/vector4-BhOKDhD5.mjs.map +0 -1
  141. package/dist/shared/vector4.internal-5XcaX12X.mjs.map +0 -1
  142. package/dist/solution/index.d.mts +0 -2
  143. package/dist/splines/index.d.mts +0 -858
  144. package/dist/utils.d.mts +0 -2
  145. package/dist/vector/index.d.mts +0 -3
@@ -0,0 +1,204 @@
1
+ import type { Pipeable } from '../utils.ts';
2
+ import type { Vector2 } from '../vector/vector2.ts';
3
+ import type { Bounds, Closed, Interval } from './interval.ts';
4
+ import type { Interval2dTypeId } from './interval2d.internal.ts';
5
+ /**
6
+ * An axis-aligned 2D interval — the Cartesian product of two 1D intervals.
7
+ * Used as a bounding box for curves and paths, and as a region for
8
+ * containment tests.
9
+ *
10
+ * The two type parameters carry the per-axis interval subtype so that a value
11
+ * built from closed intervals stays `Interval2d<Closed, Closed>` and a value
12
+ * with mixed openness preserves that information at the type level.
13
+ *
14
+ * All fields are readonly and immutable, and all operations create new instances.
15
+ *
16
+ * @since 2.0.0
17
+ */
18
+ export interface Interval2d<X extends Interval = Interval, Y extends Interval = Interval> extends Pipeable {
19
+ readonly [Interval2dTypeId]: Interval2dTypeId;
20
+ readonly x: X;
21
+ readonly y: Y;
22
+ }
23
+ /**
24
+ * The structural minimum: any value with `x` and `y` fields shaped like
25
+ * {@link Bounds}. Operations that don't read endpoint inclusivity (e.g.
26
+ * {@link size}) accept `Bounds2d` so the signature itself documents what the
27
+ * operation depends on. Mirrors the {@link Bounds}/{@link Interval} split in 1D.
28
+ *
29
+ * @since 2.0.0
30
+ */
31
+ export interface Bounds2d {
32
+ readonly x: Bounds;
33
+ readonly y: Bounds;
34
+ }
35
+ /**
36
+ * Checks if a value is an `Interval2d`.
37
+ *
38
+ * @param v - The value to check.
39
+ * @returns `true` if the value is an `Interval2d`, `false` otherwise.
40
+ * @since 2.0.0
41
+ */
42
+ export declare const isInterval2d: (v: unknown) => v is Interval2d;
43
+ /**
44
+ * Creates a new `Interval2d` from two intervals — one for the x axis, one
45
+ * for the y axis. Preserves both interval subtypes at the type level.
46
+ *
47
+ * @param x - The x-axis interval.
48
+ * @param y - The y-axis interval.
49
+ * @returns A new `Interval2d` instance.
50
+ * @since 2.0.0
51
+ */
52
+ export declare const make: <X extends Interval, Y extends Interval>(x: X, y: Y) => Interval2d<X, Y>;
53
+ /**
54
+ * Creates a closed `Interval2d` from two corner points. The corners can be in
55
+ * any order — each axis is built from the min and max of the coordinate.
56
+ *
57
+ * @param p0 - The first corner.
58
+ * @param p1 - The second corner.
59
+ * @returns A new `Interval2d<Closed, Closed>` enclosing both corners.
60
+ * @since 2.0.0
61
+ */
62
+ export declare const fromCorners: (p0: Vector2, p1: Vector2) => Interval2d<Closed, Closed>;
63
+ /**
64
+ * Creates the smallest closed `Interval2d` enclosing the given points. Useful
65
+ * for computing a bounding box from sampled points.
66
+ *
67
+ * @param points - One or more points to enclose.
68
+ * @returns A new `Interval2d<Closed, Closed>` enclosing all input points.
69
+ * @throws When called with zero points.
70
+ * @since 2.0.0
71
+ */
72
+ export declare const fromVectors: (...points: ReadonlyArray<Vector2>) => Interval2d<Closed, Closed>;
73
+ export declare const containsVector: {
74
+ /**
75
+ * Checks if a vector lies within the 2D interval. Per-axis endpoint
76
+ * inclusivity follows each axis interval's `kind`.
77
+ *
78
+ * @param box - The 2D interval to test against.
79
+ * @param v - The vector to test.
80
+ * @returns `true` when the vector lies within the box on both axes.
81
+ * @since 2.0.0
82
+ */
83
+ (box: Interval2d, v: Vector2): boolean;
84
+ /**
85
+ * @param v - The vector to test.
86
+ * @returns A function that takes a 2D interval and returns the containment result.
87
+ * @since 2.0.0
88
+ */
89
+ (v: Vector2): (box: Interval2d) => boolean;
90
+ };
91
+ export declare const containsInterval2d: {
92
+ /**
93
+ * Checks if `inner` is a subset of `outer`. The check is per-axis interval
94
+ * containment — for each axis, every point of the inner interval must also
95
+ * be in the outer interval, respecting endpoint inclusivity on both sides.
96
+ *
97
+ * @param outer - The enclosing 2D interval.
98
+ * @param inner - The candidate inner 2D interval.
99
+ * @returns `true` when every point of `inner` is also in `outer`.
100
+ * @since 2.0.0
101
+ */
102
+ (outer: Interval2d, inner: Interval2d): boolean;
103
+ /**
104
+ * @param inner - The candidate inner 2D interval.
105
+ * @returns A function that takes the outer 2D interval and returns the containment result.
106
+ * @since 2.0.0
107
+ */
108
+ (inner: Interval2d): (outer: Interval2d) => boolean;
109
+ };
110
+ /**
111
+ * Returns the size as a vector `(width, height)`. Accepts the broader
112
+ * {@link Bounds2d} type because size does not depend on endpoint inclusivity.
113
+ *
114
+ * @param box - The 2D interval (or bounds-shaped value) to measure.
115
+ * @returns The size as a `Vector2`.
116
+ * @since 2.0.0
117
+ */
118
+ export declare const size: (box: Bounds2d) => Vector2;
119
+ export declare const union: {
120
+ /**
121
+ * Returns the smallest 2D interval enclosing both inputs.
122
+ *
123
+ * The per-axis return kind is determined by which input's endpoint wins on
124
+ * each side, with the contributor's openness preserved (or unioned to
125
+ * "closed" when endpoints are numerically equal and either is closed at
126
+ * that point).
127
+ *
128
+ * When both inputs share the same kind on an axis, the result collapses
129
+ * back to that kind. Otherwise the axis falls back to the open
130
+ * {@link Interval} type since the runtime kind depends on the values.
131
+ *
132
+ * @param a - The first 2D interval.
133
+ * @param b - The second 2D interval.
134
+ * @returns A new `Interval2d` enclosing both inputs.
135
+ * @since 2.0.0
136
+ */
137
+ <AX extends Interval, AY extends Interval, BX extends Interval, BY extends Interval>(a: Interval2d<AX, AY>, b: Interval2d<BX, BY>): Interval2d<AX extends BX ? (BX extends AX ? AX : Interval) : Interval, AY extends BY ? (BY extends AY ? AY : Interval) : Interval>;
138
+ /**
139
+ * @param b - The second 2D interval.
140
+ * @returns A function that takes the first 2D interval and returns the union.
141
+ * @since 2.0.0
142
+ */
143
+ <BX extends Interval, BY extends Interval>(b: Interval2d<BX, BY>): <AX extends Interval, AY extends Interval>(a: Interval2d<AX, AY>) => Interval2d<AX extends BX ? (BX extends AX ? AX : Interval) : Interval, AY extends BY ? (BY extends AY ? AY : Interval) : Interval>;
144
+ };
145
+ export declare const equals: {
146
+ /**
147
+ * Checks if two `Interval2d` values are approximately equal within the
148
+ * default absolute tolerance ({@link EPSILON}). Both the numeric endpoints
149
+ * AND the per-axis kinds must match.
150
+ *
151
+ * @param a - The first 2D interval.
152
+ * @param b - The second 2D interval.
153
+ * @returns `true` when both axes are equal.
154
+ * @since 2.0.0
155
+ */
156
+ (a: Interval2d, b: Interval2d): boolean;
157
+ /**
158
+ * @param b - The second 2D interval.
159
+ * @returns A function that takes the first 2D interval and returns the comparison result.
160
+ * @since 2.0.0
161
+ */
162
+ (b: Interval2d): (a: Interval2d) => boolean;
163
+ };
164
+ export declare const minDistance: {
165
+ /**
166
+ * Euclidean distance between the two closest points of two axis-aligned 2D
167
+ * intervals. Returns `0` when the boxes overlap (including edge or corner
168
+ * touching). Accepts the broader {@link Bounds2d} type — endpoint
169
+ * inclusivity is not consulted, so a "touching" pair of open intervals still
170
+ * returns `0` because the closest *points* coincide geometrically.
171
+ *
172
+ * @param a - The first 2D interval.
173
+ * @param b - The second 2D interval.
174
+ * @returns The minimum Euclidean distance between any point of `a` and any point of `b`.
175
+ * @since 2.0.0
176
+ */
177
+ (a: Bounds2d, b: Bounds2d): number;
178
+ /**
179
+ * @param b - The second 2D interval.
180
+ * @returns A function that takes the first 2D interval and returns the minimum distance.
181
+ * @since 2.0.0
182
+ */
183
+ (b: Bounds2d): (a: Bounds2d) => number;
184
+ };
185
+ export declare const maxDistance: {
186
+ /**
187
+ * Euclidean distance between the two farthest points of two axis-aligned 2D
188
+ * intervals. Equals the diagonal of the union AABB enclosing both inputs.
189
+ * Accepts the broader {@link Bounds2d} type — endpoint inclusivity is not
190
+ * consulted.
191
+ *
192
+ * @param a - The first 2D interval.
193
+ * @param b - The second 2D interval.
194
+ * @returns The maximum Euclidean distance between any point of `a` and any point of `b`.
195
+ * @since 2.0.0
196
+ */
197
+ (a: Bounds2d, b: Bounds2d): number;
198
+ /**
199
+ * @param b - The second 2D interval.
200
+ * @returns A function that takes the first 2D interval and returns the maximum distance.
201
+ * @since 2.0.0
202
+ */
203
+ (b: Bounds2d): (a: Bounds2d) => number;
204
+ };
@@ -0,0 +1,2 @@
1
+ export declare const Interval2dTypeId: unique symbol;
2
+ export type Interval2dTypeId = typeof Interval2dTypeId;
@@ -0,0 +1,32 @@
1
+ export declare const GL32_X0 = 0.9972638618494816;
2
+ export declare const GL32_X1 = 0.9856115115452684;
3
+ export declare const GL32_X2 = 0.9647622555875064;
4
+ export declare const GL32_X3 = 0.9349060759377397;
5
+ export declare const GL32_X4 = 0.8963211557660521;
6
+ export declare const GL32_X5 = 0.84936761373257;
7
+ export declare const GL32_X6 = 0.7944837959679424;
8
+ export declare const GL32_X7 = 0.7321821187402897;
9
+ export declare const GL32_X8 = 0.6630442669302152;
10
+ export declare const GL32_X9 = 0.5877157572407623;
11
+ export declare const GL32_X10 = 0.5068999089322294;
12
+ export declare const GL32_X11 = 0.42135127613063533;
13
+ export declare const GL32_X12 = 0.33186860228212767;
14
+ export declare const GL32_X13 = 0.23928736225213706;
15
+ export declare const GL32_X14 = 0.1444719615827965;
16
+ export declare const GL32_X15 = 0.04830766568773831;
17
+ export declare const GL32_W0 = 0.007018610009470136;
18
+ export declare const GL32_W1 = 0.01627439473090571;
19
+ export declare const GL32_W2 = 0.02539206530926214;
20
+ export declare const GL32_W3 = 0.03427386291302141;
21
+ export declare const GL32_W4 = 0.042835898022226704;
22
+ export declare const GL32_W5 = 0.050998059262376154;
23
+ export declare const GL32_W6 = 0.05868409347853558;
24
+ export declare const GL32_W7 = 0.06582222277636195;
25
+ export declare const GL32_W8 = 0.07234579410884862;
26
+ export declare const GL32_W9 = 0.07819389578707044;
27
+ export declare const GL32_W10 = 0.08331192422694672;
28
+ export declare const GL32_W11 = 0.08765209300440374;
29
+ export declare const GL32_W12 = 0.0911738786957639;
30
+ export declare const GL32_W13 = 0.09384439908080454;
31
+ export declare const GL32_W14 = 0.09563872007927485;
32
+ export declare const GL32_W15 = 0.09654008851472785;
@@ -0,0 +1,9 @@
1
+ import * as Matrix2x2Ns from './matrix2x2.ts';
2
+ import * as Matrix3x3Ns from './matrix3x3.ts';
3
+ import * as Matrix4x4Ns from './matrix4x4.ts';
4
+ export type Matrix2x2 = Matrix2x2Ns.Matrix2x2;
5
+ export { Matrix2x2Ns as Matrix2x2 };
6
+ export type Matrix3x3 = Matrix3x3Ns.Matrix3x3;
7
+ export { Matrix3x3Ns as Matrix3x3 };
8
+ export type Matrix4x4 = Matrix4x4Ns.Matrix4x4;
9
+ export { Matrix4x4Ns as Matrix4x4 };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "../shared/chunk-25Hzd3z8.mjs";
2
- import { A as isMatrix2x2$1, B as transpose$2, C as vectorProductLeft$3, D as equals$2, E as determinant$2, F as setColumn$2, H as vectorProductRight$2, I as setRow$2, L as solveSystem$2, M as reverseColumns$2, N as reverseRows$2, O as fromColumns$2, P as rowVector$2, R as toColumns$2, S as transpose$3, T as columnVector$2, V as vectorProductLeft$2, _ as setColumn$3, b as toColumns$3, c as equals$3, d as isMatrix3x3$1, f as make$3, g as rowVector$3, h as reverseRows$3, j as make$2, k as fromRows$2, l as fromColumns$3, m as reverseColumns$3, o as columnVector$3, p as minor$1, r as matrix4x4_exports, s as determinant$3, u as fromRows$3, v as setRow$3, w as vectorProductRight$3, x as toRows$3, y as solveSystem$3, z as toRows$2 } from "../shared/matrix4x4-Ck2WROK-.mjs";
2
+ import { A as isMatrix2x2$1, B as transpose$2, C as vectorProductLeft$3, D as equals$2, E as determinant$2, F as setColumn$2, H as vectorProductRight$2, I as setRow$2, L as solveSystem$2, M as reverseColumns$2, N as reverseRows$2, O as fromColumns$2, P as rowVector$2, R as toColumns$2, S as transpose$3, T as columnVector$2, V as vectorProductLeft$2, _ as setColumn$3, b as toColumns$3, c as equals$3, d as isMatrix3x3$1, f as make$3, g as rowVector$3, h as reverseRows$3, j as make$2, k as fromRows$2, l as fromColumns$3, m as reverseColumns$3, o as columnVector$3, p as minor$1, r as matrix4x4_exports, s as determinant$3, u as fromRows$3, v as setRow$3, w as vectorProductRight$3, x as toRows$3, y as solveSystem$3, z as toRows$2 } from "../shared/matrix4x4-qyRufxfs.mjs";
3
3
  //#region src/matrix/matrix2x2.ts
4
4
  var matrix2x2_exports = /* @__PURE__ */ __exportAll({
5
5
  columnVector: () => columnVector$1,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["internal.isMatrix2x2","equals","internal.equals","make","internal.make","fromRows","internal.fromRows","fromColumns","internal.fromColumns","setRow","internal.setRow","setColumn","internal.setColumn","determinant","internal.determinant","vectorProductLeft","internal.vectorProductLeft","vectorProductRight","internal.vectorProductRight","solveSystem","internal.solveSystem","toRows","internal.toRows","toColumns","internal.toColumns","rowVector","internal.rowVector","columnVector","internal.columnVector","transpose","internal.transpose","reverseRows","internal.reverseRows","reverseColumns","internal.reverseColumns","internal.isMatrix3x3","internal.equals","internal.make","internal.fromRows","internal.fromColumns","internal.setRow","internal.setColumn","internal.determinant","internal.minor","internal.vectorProductLeft","internal.vectorProductRight","internal.solveSystem","internal.toRows","internal.toColumns","internal.rowVector","internal.columnVector","internal.transpose","internal.reverseRows","internal.reverseColumns"],"sources":["../../src/matrix/matrix2x2.ts","../../src/matrix/matrix3x3.ts"],"sourcesContent":["import type { TwoDimensionalComponent, TwoDimensionalIndex } from '../dimensions'\nimport type { Pipeable } from '../utils'\nimport type { Vector2 } from '../vector/vector2'\nimport type { Matrix2x2TypeId } from './matrix2x2.internal'\nimport * as internal from './matrix2x2.internal'\n\n/**\n * A type representing the coordinate of a 2D matrix.\n *\n * @since 1.0.0\n */\nexport type Matrix2x2Coordinate = TwoDimensionalIndex | TwoDimensionalComponent\n\n/**\n * A 2D matrix with 2 rows and 2 columns.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Matrix2x2 extends Pipeable {\n readonly [Matrix2x2TypeId]: Matrix2x2TypeId\n\n /**\n * The value in the first row and first column.\n */\n readonly m00: number\n /**\n * The value in the first row and second column.\n */\n readonly m01: number\n /**\n * The value in the second row and first column.\n */\n readonly m10: number\n /**\n * The value in the second row and second column.\n */\n readonly m11: number\n}\n\n/**\n * Checks if a value is a `Matrix2x2`.\n *\n * @param m - The value to check.\n * @returns `true` if the value is a `Matrix2x2`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isMatrix2x2: (m: unknown) => m is Matrix2x2 = internal.isMatrix2x2\n\nexport const equals: {\n /**\n * Checks if two `Matrix2x2` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Matrix2x2, b: Matrix2x2): boolean\n /**\n * Checks if two `Matrix2x2` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second matrix.\n * @returns A function that takes the first matrix and returns the comparison result.\n * @since 1.1.0\n */\n (b: Matrix2x2): (a: Matrix2x2) => boolean\n} = internal.equals\n\n/**\n * Creates a new `Matrix2x2` instance.\n *\n * @param m00 - The value in the first row and first column. Defaults to 0.\n * @param m01 - The value in the first row and second column. Defaults to 0.\n * @param m10 - The value in the second row and first column. Defaults to 0.\n * @param m11 - The value in the second row and second column. Defaults to 0.\n */\nexport const make: (m00?: number, m01?: number, m10?: number, m11?: number) => Matrix2x2 =\n internal.make\n\n/**\n * Creates a new `Matrix2x2` instance from two vectors representing rows.\n *\n * @param v0 - The first row vector.\n * @param v1 - The second row vector.\n * @returns A new `Matrix2x2` instance.\n * @since 1.0.0\n */\nexport const fromRows: (v0: Vector2, v1: Vector2) => Matrix2x2 = internal.fromRows\n\n/**\n * Creates a new `Matrix2x2` instance from two vectors representing columns.\n *\n * @param v0 - The first column vector.\n * @param v1 - The second column vector.\n * @returns A new `Matrix2x2` instance.\n * @since 1.0.0\n */\nexport const fromColumns: (v0: Vector2, v1: Vector2) => Matrix2x2 = internal.fromColumns\n\nexport const setRow: {\n /**\n * Sets the specified row of the matrix to the given vector.\n *\n * @param m - The matrix to modify.\n * @param row - The row index (0 or 1).\n * @param v - The vector to set the row to.\n * @returns A new `Matrix2x2` instance with the specified row set to the given vector.\n * @since 1.0.0\n */\n (m: Matrix2x2, row: Matrix2x2Coordinate, v: Vector2): Matrix2x2\n /**\n * Sets the specified row of the matrix to the given vector.\n *\n * @param row - The row index (0 or 1).\n * @param v - The vector to set the row to.\n * @returns A function that takes a matrix and returns a new `Matrix2x2` instance with the specified row set to the given vector.\n * @since 1.0.0\n */\n (row: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2\n} = internal.setRow\n\nexport const setColumn: {\n /**\n * Sets the specified column of the matrix to the given vector.\n *\n * @param m - The matrix to modify.\n * @param column - The column index (0 or 1).\n * @param v - The vector to set the column to.\n * @returns A new `Matrix2x2` instance with the specified column set to the given vector.\n * @since 1.0.0\n */\n (m: Matrix2x2, column: Matrix2x2Coordinate, v: Vector2): Matrix2x2\n /**\n * Sets the specified column of the matrix to the given vector.\n *\n * @param column - The column index (0 or 1).\n * @param v - The vector to set the column to.\n * @returns A function that takes a matrix and returns a new `Matrix2x2` instance with the specified column set to the given vector.\n * @since 1.0.0\n */\n (column: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2\n} = internal.setColumn\n\n/**\n * Calculates the determinant of a 2D matrix.\n *\n * @param m - The matrix to calculate the determinant for.\n * @returns The determinant of the matrix.\n * @since 1.0.0\n */\nexport const determinant: (m: Matrix2x2) => number = internal.determinant\n\nexport const vectorProductLeft: {\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 2 * 6 = 17\n * // y = 3 * 5 + 4 * 6 = 39\n * const result = Matrix2x2.vectorProductLeft(matrix, vector)\n * ```\n * @param m - The matrix to multiply.\n * @param v - The vector to multiply.\n * @returns The resulting vector after the left vector product.\n * @since 1.0.0\n */\n (m: Matrix2x2, v: Vector2): Vector2\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 2 * 6 = 17\n * // y = 3 * 5 + 4 * 6 = 39\n * const result = Matrix2x2.vectorProductLeft(vector)(matrix)\n * ```\n * @param v - The vector to multiply.\n * @returns A function that takes a matrix and returns the resulting vector after the left vector product.\n * @since 1.0.0\n */\n (v: Vector2): (m: Matrix2x2) => Vector2\n} = internal.vectorProductLeft\n\nexport const vectorProductRight: {\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 3 * 6 = 33\n * // y = 2 * 5 + 4 * 6 = 62\n * const result = Matrix2x2.vectorProductRight(matrix, vector)\n * ```\n * @param m - The matrix to multiply.\n * @param v - The vector to multiply.\n * @returns The resulting vector after the right vector product.\n * @since 1.0.0\n */\n (m: Matrix2x2, v: Vector2): Vector2\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 3 * 6 = 33\n * // y = 2 * 5 + 4 * 6 = 62\n * const result = Matrix2x2.vectorProductRight(vector)(matrix)\n * ```\n * @param v - The vector to multiply.\n * @returns A function that takes a matrix and returns the resulting vector after the right vector product.\n * @since 1.0.0\n */\n (v: Vector2): (m: Matrix2x2) => Vector2\n} = internal.vectorProductRight\n\nexport const solveSystem: {\n /**\n * Solves a system of linear equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Solves the system of equations:\n * // 1x + 2y = 5\n * // 3x + 4y = 6\n * const result = Matrix2x2.solveSystem(matrix, vector)\n * ```\n * @param m - The matrix representing the coefficients of the system.\n * @param v - The vector representing the constants of the system.\n * @returns The solution vector.\n * @since 1.0.0\n */\n (m: Matrix2x2, v: Vector2): Vector2\n /**\n * Solves a system of linear equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Solves the system of equations:\n * // 1x + 2y = 5\n * // 3x + 4y = 6\n * const result = Matrix2x2.solveSystem(vector)(matrix)\n * ```\n * @param v - The vector representing the constants of the system.\n * @returns A function that takes a matrix and returns the solution vector.\n * @since 1.0.0\n */\n (v: Vector2): (m: Matrix2x2) => Vector2\n} = internal.solveSystem\n\n/**\n * Returns the rows of a matrix as an array of vectors.\n *\n * @param m - The matrix to convert.\n * @returns An array of vectors representing the rows of the matrix.\n * @since 1.0.0\n */\nexport const toRows: (m: Matrix2x2) => [Vector2, Vector2] = internal.toRows\n\n/**\n * Returns the columns of a matrix as an array of vectors.\n *\n * @param m - The matrix to convert.\n * @returns An array of vectors representing the columns of the matrix.\n * @since 1.0.0\n */\nexport const toColumns: (m: Matrix2x2) => [Vector2, Vector2] = internal.toColumns\n\n/**\n * Returns the specified row of a matrix as a vector.\n *\n * @param m - The matrix to get the row from.\n * @param row - The row index (0 or 1).\n * @returns A vector representing the specified row of the matrix.\n * @since 1.0.0\n */\nexport const rowVector: (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2 = internal.rowVector\n\n/**\n * Returns the specified column of a matrix as a vector.\n *\n * @param m - The matrix to get the column from.\n * @param column - The column index (0 or 1).\n * @returns A vector representing the specified column of the matrix.\n * @since 1.0.0\n */\nexport const columnVector: (m: Matrix2x2, column: Matrix2x2Coordinate) => Vector2 =\n internal.columnVector\n\n/**\n * Transposes a matrix.\n *\n * @param m - The matrix to transpose.\n * @returns A new `Matrix2x2` instance representing the transposed matrix.\n * @since 1.0.0\n */\nexport const transpose: (m: Matrix2x2) => Matrix2x2 = internal.transpose\n\n/**\n * Reverses the rows of a matrix.\n *\n * @param m - The matrix to reverse the rows of.\n * @returns A new `Matrix2x2` instance with the rows reversed.\n * @since 1.0.0\n */\nexport const reverseRows: (m: Matrix2x2) => Matrix2x2 = internal.reverseRows\n\n/**\n * Reverses the columns of a matrix.\n *\n * @param m - The matrix to reverse the columns of.\n * @returns A new `Matrix2x2` instance with the columns reversed.\n * @since 1.0.0\n */\nexport const reverseColumns: (m: Matrix2x2) => Matrix2x2 = internal.reverseColumns\n","import type { ThreeDimensionalComponent, ThreeDimensionalIndex } from '../dimensions'\nimport type { Pipeable } from '../utils'\nimport type { Vector3 } from '../vector/vector3'\nimport type { Matrix2x2 } from './matrix2x2'\nimport type { Matrix3x3TypeId } from './matrix3x3.internal'\nimport * as internal from './matrix3x3.internal'\n\n/**\n * A coordinate in a 3x3 matrix.\n *\n * @since 1.0.0\n */\nexport type Matrix3x3Coordinate = ThreeDimensionalIndex | ThreeDimensionalComponent\n\n/**\n * A 3x3 matrix.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Matrix3x3 extends Pipeable {\n readonly [Matrix3x3TypeId]: Matrix3x3TypeId\n /**\n * The value of the first row and first column.\n */\n readonly m00: number\n /**\n * The value of the first row and second column.\n */\n readonly m01: number\n /**\n * The value of the first row and third column.\n */\n readonly m02: number\n /**\n * The value of the second row and first column.\n */\n readonly m10: number\n /**\n * The value of the second row and second column.\n */\n readonly m11: number\n /**\n * The value of the second row and third column.\n */\n readonly m12: number\n /**\n * The value of the third row and first column.\n */\n readonly m20: number\n /**\n * The value of the third row and second column.\n */\n readonly m21: number\n /**\n * The value of the third row and third column.\n */\n readonly m22: number\n}\n\n/**\n * Checks if a value is a `Matrix3x3`.\n *\n * @param m - The value to check.\n * @returns `true` if the value is a `Matrix3x3`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isMatrix3x3: (m: unknown) => m is Matrix3x3 = internal.isMatrix3x3\n\nexport const equals: {\n /**\n * Checks if two `Matrix3x3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Matrix3x3, b: Matrix3x3): boolean\n /**\n * Checks if two `Matrix3x3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second matrix.\n * @returns A function that takes the first matrix and returns the comparison result.\n * @since 1.1.0\n */\n (b: Matrix3x3): (a: Matrix3x3) => boolean\n} = internal.equals\n\n/**\n * Creates a new `Matrix3x3` instance.\n *\n * @param m00 - The value of the first row and first column.\n * @param m01 - The value of the first row and second column.\n * @param m02 - The value of the first row and third column.\n * @param m10 - The value of the second row and first column.\n * @param m11 - The value of the second row and second column.\n * @param m12 - The value of the second row and third column.\n * @param m20 - The value of the third row and first column.\n * @param m21 - The value of the third row and second column.\n * @param m22 - The value of the third row and third column.\n * @returns A new `Matrix3x3` instance.\n * @since 1.0.0\n */\nexport const make: (\n m00?: number,\n m01?: number,\n m02?: number,\n m10?: number,\n m11?: number,\n m12?: number,\n m20?: number,\n m21?: number,\n m22?: number,\n) => Matrix3x3 = internal.make\n\n/**\n * Creates a new `Matrix3x3` instance from three row vectors.\n *\n * @param v0 - The first row vector.\n * @param v1 - The second row vector.\n * @param v2 - The third row vector.\n * @returns A new `Matrix3x3` instance.\n * @since 1.0.0\n */\nexport const fromRows: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3 = internal.fromRows\n\n/**\n * Creates a new `Matrix3x3` instance from three column vectors.\n *\n * @param v0 - The first column vector.\n * @param v1 - The second column vector.\n * @param v2 - The third column vector.\n * @returns A new `Matrix3x3` instance.\n * @since 1.0.0\n */\nexport const fromColumns: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3 =\n internal.fromColumns\n\nexport const setRow: {\n /**\n * Sets a row of the matrix to a new vector.\n *\n * @param m - The matrix to set the row of.\n * @param row - The row index to set.\n * @param v - The new vector for the row.\n * @returns A new matrix with the specified row set to the new vector.\n * @since 1.0.0\n */\n (m: Matrix3x3, row: Matrix3x3Coordinate, v: Vector3): Matrix3x3\n /**\n * Sets a row of the matrix to a new vector.\n *\n * @param row - The row index to set.\n * @param v - The new vector for the row.\n * @returns A function that takes a matrix and returns a new matrix with the specified row set to the new vector.\n * @since 1.0.0\n */\n (row: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3\n} = internal.setRow\n\nexport const setColumn: {\n /**\n * Sets a column of the matrix to a new vector.\n *\n * @param m - The matrix to set the column of.\n * @param column - The column index to set.\n * @param v - The new vector for the column.\n * @returns A new matrix with the specified column set to the new vector.\n * @since 1.0.0\n */\n (m: Matrix3x3, column: Matrix3x3Coordinate, v: Vector3): Matrix3x3\n /**\n * Sets a column of the matrix to a new vector.\n *\n * @param column - The column index to set.\n * @param v - The new vector for the column.\n * @returns A function that takes a matrix and returns a new matrix with the specified column set to the new vector.\n * @since 1.0.0\n */\n (column: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3\n} = internal.setColumn\n\n/**\n * Calculates the determinant of a 3x3 matrix.\n *\n * @param m - The matrix to calculate the determinant of.\n * @returns The determinant of the matrix.\n * @since 1.0.0\n */\nexport const determinant: (m: Matrix3x3) => number = internal.determinant\n\n/**\n * Calculates the minor of a 3x3 matrix.\n *\n * @param m - The matrix to calculate the minor of.\n * @param row - The row index of the element to calculate the minor for.\n * @param column - The column index of the element to calculate the minor for.\n * @returns The minor of the matrix at the specified row and column.\n * @since 1.0.0\n */\nexport const minor: (\n m: Matrix3x3,\n row: Matrix3x3Coordinate,\n column: Matrix3x3Coordinate,\n) => Matrix2x2 = internal.minor\n\nexport const vectorProductLeft: {\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 2 * 11 + 3 * 12\n * // y = 4 * 10 + 5 * 11 + 6 * 12\n * // z = 7 * 10 + 8 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductLeft(m, v)\n * ```\n * @param m - The matrix to calculate the left vector product with.\n * @param v - The vector to calculate the left vector product with.\n * @returns The resulting vector from the left vector product.\n * @since 1.0.0\n */\n (m: Matrix3x3, v: Vector3): Vector3\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 2 * 11 + 3 * 12\n * // y = 4 * 10 + 5 * 11 + 6 * 12\n * // z = 7 * 10 + 8 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductLeft(v)(m)\n * ```\n * @param v - The vector to calculate the left vector product with.\n * @returns A function that takes a matrix and returns the resulting vector from the left vector product.\n * @since 1.0.0\n */\n (v: Vector3): (m: Matrix3x3) => Vector3\n} = internal.vectorProductLeft\n\nexport const vectorProductRight: {\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 4 * 11 + 7 * 12\n * // y = 2 * 10 + 5 * 11 + 8 * 12\n * // z = 3 * 10 + 6 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductRight(m, v)\n * ```\n * @param m - The matrix to calculate the right vector product with.\n * @param v - The vector to calculate the right vector product with.\n * @returns The resulting vector from the right vector product.\n * @since 1.0.0\n */\n (m: Matrix3x3, v: Vector3): Vector3\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 4 * 11 + 7 * 12\n * // y = 2 * 10 + 5 * 11 + 8 * 12\n * // z = 3 * 10 + 6 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductRight(v)(m)\n * ```\n * @param v - The vector to calculate the right vector product with.\n * @returns A function that takes a matrix and returns the resulting vector from the right vector product.\n * @since 1.0.0\n */\n (v: Vector3): (m: Matrix3x3) => Vector3\n} = internal.vectorProductRight\n\nexport const solveSystem: {\n /**\n * Solves a system of equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = m00 * x + m01 * y + m02 * z\n * // y = m10 * x + m11 * y + m12 * z\n * // z = m20 * x + m21 * y + m22 * z\n * const result = Matrix3x3.solveSystem(m, v)\n * ```\n * @since 1.0.0\n */\n (m: Matrix3x3, v: Vector3): Vector3\n /**\n * Solves a system of equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = m00 * x + m01 * y + m02 * z\n * // y = m10 * x + m11 * y + m12 * z\n * // z = m20 * x + m21 * y + m22 * z\n * const result = Matrix3x3.solveSystem(v)(m)\n * ```\n * @since 1.0.0\n */\n (v: Vector3): (m: Matrix3x3) => Vector3\n} = internal.solveSystem\n\n/**\n * Returns the rows of a `Matrix3x3` as an array of vectors.\n *\n * @param m - The matrix to get the rows from.\n * @returns An array of vectors representing the rows of the matrix.\n * @since 1.0.0\n */\nexport const toRows: (m: Matrix3x3) => [Vector3, Vector3, Vector3] = internal.toRows as (\n m: Matrix3x3,\n) => [Vector3, Vector3, Vector3]\n\n/**\n * Returns the columns of a `Matrix3x3` as an array of vectors.\n *\n * @param m - The matrix to get the columns from.\n * @returns An array of vectors representing the columns of the matrix.\n * @since 1.0.0\n */\nexport const toColumns: (m: Matrix3x3) => [Vector3, Vector3, Vector3] = internal.toColumns as (\n m: Matrix3x3,\n) => [Vector3, Vector3, Vector3]\n\nexport const rowVector: {\n /**\n * Gets a row vector from the matrix.\n *\n * @param m - The matrix to get the row vector from.\n * @param row - The row index to get the vector from.\n * @returns The row vector at the specified index.\n * @since 1.0.0\n */\n (m: Matrix3x3, row: Matrix3x3Coordinate): Vector3\n /**\n * Gets a row vector from the matrix.\n *\n * @param row - The row index to get the vector from.\n * @returns A function that takes a matrix and returns the row vector at the specified index.\n * @since 1.0.0\n */\n (row: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3\n} = internal.rowVector\n\nexport const columnVector: {\n /**\n * Gets a column vector from the matrix.\n *\n * @param m - The matrix to get the column vector from.\n * @param column - The column index to get the vector from.\n * @returns The column vector at the specified index.\n * @since 1.0.0\n */\n (m: Matrix3x3, column: Matrix3x3Coordinate): Vector3\n /**\n * Gets a column vector from the matrix.\n *\n * @param column - The column index to get the vector from.\n * @returns A function that takes a matrix and returns the column vector at the specified index.\n * @since 1.0.0\n */\n (column: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3\n} = internal.columnVector\n\n/**\n * Transposes a `Matrix3x3`.\n *\n * @param m - The matrix to transpose.\n * @returns A new `Matrix3x3` instance that is the transpose of the input matrix.\n * @since 1.0.0\n */\nexport const transpose: (m: Matrix3x3) => Matrix3x3 = internal.transpose\n\n/**\n * Reverses the rows of a `Matrix3x3`.\n *\n * @param m - The matrix to reverse the rows of.\n * @returns A new `Matrix3x3` instance with the rows reversed.\n * @since 1.0.0\n */\nexport const reverseRows: (m: Matrix3x3) => Matrix3x3 = internal.reverseRows\n\n/**\n * Reverses the columns of a `Matrix3x3`.\n *\n * @param m - The matrix to reverse the columns of.\n * @returns A new `Matrix3x3` instance with the columns reversed.\n * @since 1.0.0\n */\nexport const reverseColumns: (m: Matrix3x3) => Matrix3x3 = internal.reverseColumns\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,cAA8CA;AAE3D,MAAaC,WAoBTC;;;;;;;;;AAUJ,MAAaC,SACXC;;;;;;;;;AAUF,MAAaC,aAAoDC;;;;;;;;;AAUjE,MAAaC,gBAAuDC;AAEpE,MAAaC,WAoBTC;AAEJ,MAAaC,cAoBTC;;;;;;;;AASJ,MAAaC,gBAAwCC;AAErD,MAAaC,sBA4CTC;AAEJ,MAAaC,uBA4CTC;AAEJ,MAAaC,gBA4CTC;;;;;;;;AASJ,MAAaC,WAA+CC;;;;;;;;AAS5D,MAAaC,cAAkDC;;;;;;;;;AAU/D,MAAaC,cAAiEC;;;;;;;;;AAU9E,MAAaC,iBACXC;;;;;;;;AASF,MAAaC,cAAyCC;;;;;;;;AAStD,MAAaC,gBAA2CC;;;;;;;;AASxD,MAAaC,mBAA8CC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClS3D,MAAa,cAA8CC;AAE3D,MAAa,SAoBTC;;;;;;;;;;;;;;;;AAiBJ,MAAa,OAUIC;;;;;;;;;;AAWjB,MAAa,WAAiEC;;;;;;;;;;AAW9E,MAAa,cACXC;AAEF,MAAa,SAoBTC;AAEJ,MAAa,YAoBTC;;;;;;;;AASJ,MAAa,cAAwCC;;;;;;;;;;AAWrD,MAAa,QAIIC;AAEjB,MAAa,oBA8CTC;AAEJ,MAAa,qBA8CTC;AAEJ,MAAa,cAyCTC;;;;;;;;AASJ,MAAa,SAAwDC;;;;;;;;AAWrE,MAAa,YAA2DC;AAIxE,MAAa,YAkBTC;AAEJ,MAAa,eAkBTC;;;;;;;;AASJ,MAAa,YAAyCC;;;;;;;;AAStD,MAAa,cAA2CC;;;;;;;;AASxD,MAAa,iBAA8CC"}
1
+ {"version":3,"file":"index.mjs","names":["internal.isMatrix2x2","equals","internal.equals","make","internal.make","fromRows","internal.fromRows","fromColumns","internal.fromColumns","setRow","internal.setRow","setColumn","internal.setColumn","determinant","internal.determinant","vectorProductLeft","internal.vectorProductLeft","vectorProductRight","internal.vectorProductRight","solveSystem","internal.solveSystem","toRows","internal.toRows","toColumns","internal.toColumns","rowVector","internal.rowVector","columnVector","internal.columnVector","transpose","internal.transpose","reverseRows","internal.reverseRows","reverseColumns","internal.reverseColumns","internal.isMatrix3x3","internal.equals","internal.make","internal.fromRows","internal.fromColumns","internal.setRow","internal.setColumn","internal.determinant","internal.minor","internal.vectorProductLeft","internal.vectorProductRight","internal.solveSystem","internal.toRows","internal.toColumns","internal.rowVector","internal.columnVector","internal.transpose","internal.reverseRows","internal.reverseColumns"],"sources":["../../src/matrix/matrix2x2.ts","../../src/matrix/matrix3x3.ts"],"sourcesContent":["import type { TwoDimensionalComponent, TwoDimensionalIndex } from '../dimensions.ts'\nimport type { Pipeable } from '../utils.ts'\nimport type { Vector2 } from '../vector/vector2.ts'\nimport type { Matrix2x2TypeId } from './matrix2x2.internal.ts'\nimport * as internal from './matrix2x2.internal.ts'\n\n/**\n * A type representing the coordinate of a 2D matrix.\n *\n * @since 1.0.0\n */\nexport type Matrix2x2Coordinate = TwoDimensionalIndex | TwoDimensionalComponent\n\n/**\n * A 2D matrix with 2 rows and 2 columns.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Matrix2x2 extends Pipeable {\n readonly [Matrix2x2TypeId]: Matrix2x2TypeId\n\n /**\n * The value in the first row and first column.\n */\n readonly m00: number\n /**\n * The value in the first row and second column.\n */\n readonly m01: number\n /**\n * The value in the second row and first column.\n */\n readonly m10: number\n /**\n * The value in the second row and second column.\n */\n readonly m11: number\n}\n\n/**\n * Checks if a value is a `Matrix2x2`.\n *\n * @param m - The value to check.\n * @returns `true` if the value is a `Matrix2x2`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isMatrix2x2: (m: unknown) => m is Matrix2x2 = internal.isMatrix2x2\n\nexport const equals: {\n /**\n * Checks if two `Matrix2x2` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Matrix2x2, b: Matrix2x2): boolean\n /**\n * Checks if two `Matrix2x2` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second matrix.\n * @returns A function that takes the first matrix and returns the comparison result.\n * @since 1.1.0\n */\n (b: Matrix2x2): (a: Matrix2x2) => boolean\n} = internal.equals\n\n/**\n * Creates a new `Matrix2x2` instance.\n *\n * @param m00 - The value in the first row and first column. Defaults to 0.\n * @param m01 - The value in the first row and second column. Defaults to 0.\n * @param m10 - The value in the second row and first column. Defaults to 0.\n * @param m11 - The value in the second row and second column. Defaults to 0.\n */\nexport const make: (m00?: number, m01?: number, m10?: number, m11?: number) => Matrix2x2 =\n internal.make\n\n/**\n * Creates a new `Matrix2x2` instance from two vectors representing rows.\n *\n * @param v0 - The first row vector.\n * @param v1 - The second row vector.\n * @returns A new `Matrix2x2` instance.\n * @since 1.0.0\n */\nexport const fromRows: (v0: Vector2, v1: Vector2) => Matrix2x2 = internal.fromRows\n\n/**\n * Creates a new `Matrix2x2` instance from two vectors representing columns.\n *\n * @param v0 - The first column vector.\n * @param v1 - The second column vector.\n * @returns A new `Matrix2x2` instance.\n * @since 1.0.0\n */\nexport const fromColumns: (v0: Vector2, v1: Vector2) => Matrix2x2 = internal.fromColumns\n\nexport const setRow: {\n /**\n * Sets the specified row of the matrix to the given vector.\n *\n * @param m - The matrix to modify.\n * @param row - The row index (0 or 1).\n * @param v - The vector to set the row to.\n * @returns A new `Matrix2x2` instance with the specified row set to the given vector.\n * @since 1.0.0\n */\n (m: Matrix2x2, row: Matrix2x2Coordinate, v: Vector2): Matrix2x2\n /**\n * Sets the specified row of the matrix to the given vector.\n *\n * @param row - The row index (0 or 1).\n * @param v - The vector to set the row to.\n * @returns A function that takes a matrix and returns a new `Matrix2x2` instance with the specified row set to the given vector.\n * @since 1.0.0\n */\n (row: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2\n} = internal.setRow\n\nexport const setColumn: {\n /**\n * Sets the specified column of the matrix to the given vector.\n *\n * @param m - The matrix to modify.\n * @param column - The column index (0 or 1).\n * @param v - The vector to set the column to.\n * @returns A new `Matrix2x2` instance with the specified column set to the given vector.\n * @since 1.0.0\n */\n (m: Matrix2x2, column: Matrix2x2Coordinate, v: Vector2): Matrix2x2\n /**\n * Sets the specified column of the matrix to the given vector.\n *\n * @param column - The column index (0 or 1).\n * @param v - The vector to set the column to.\n * @returns A function that takes a matrix and returns a new `Matrix2x2` instance with the specified column set to the given vector.\n * @since 1.0.0\n */\n (column: Matrix2x2Coordinate, v: Vector2): (m: Matrix2x2) => Matrix2x2\n} = internal.setColumn\n\n/**\n * Calculates the determinant of a 2D matrix.\n *\n * @param m - The matrix to calculate the determinant for.\n * @returns The determinant of the matrix.\n * @since 1.0.0\n */\nexport const determinant: (m: Matrix2x2) => number = internal.determinant\n\nexport const vectorProductLeft: {\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 2 * 6 = 17\n * // y = 3 * 5 + 4 * 6 = 39\n * const result = Matrix2x2.vectorProductLeft(matrix, vector)\n * ```\n * @param m - The matrix to multiply.\n * @param v - The vector to multiply.\n * @returns The resulting vector after the left vector product.\n * @since 1.0.0\n */\n (m: Matrix2x2, v: Vector2): Vector2\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 2 * 6 = 17\n * // y = 3 * 5 + 4 * 6 = 39\n * const result = Matrix2x2.vectorProductLeft(vector)(matrix)\n * ```\n * @param v - The vector to multiply.\n * @returns A function that takes a matrix and returns the resulting vector after the left vector product.\n * @since 1.0.0\n */\n (v: Vector2): (m: Matrix2x2) => Vector2\n} = internal.vectorProductLeft\n\nexport const vectorProductRight: {\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 3 * 6 = 33\n * // y = 2 * 5 + 4 * 6 = 62\n * const result = Matrix2x2.vectorProductRight(matrix, vector)\n * ```\n * @param m - The matrix to multiply.\n * @param v - The vector to multiply.\n * @returns The resulting vector after the right vector product.\n * @since 1.0.0\n */\n (m: Matrix2x2, v: Vector2): Vector2\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Performs:\n * // x = 1 * 5 + 3 * 6 = 33\n * // y = 2 * 5 + 4 * 6 = 62\n * const result = Matrix2x2.vectorProductRight(vector)(matrix)\n * ```\n * @param v - The vector to multiply.\n * @returns A function that takes a matrix and returns the resulting vector after the right vector product.\n * @since 1.0.0\n */\n (v: Vector2): (m: Matrix2x2) => Vector2\n} = internal.vectorProductRight\n\nexport const solveSystem: {\n /**\n * Solves a system of linear equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Solves the system of equations:\n * // 1x + 2y = 5\n * // 3x + 4y = 6\n * const result = Matrix2x2.solveSystem(matrix, vector)\n * ```\n * @param m - The matrix representing the coefficients of the system.\n * @param v - The vector representing the constants of the system.\n * @returns The solution vector.\n * @since 1.0.0\n */\n (m: Matrix2x2, v: Vector2): Vector2\n /**\n * Solves a system of linear equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix2x2 from 'curvy/matrix2x2'\n * import * as Vector2 from 'curvy/vector2'\n *\n * const matrix = Matrix2x2.make(1, 2, 3, 4)\n * const vector = Vector2.make(5, 6)\n *\n * // Solves the system of equations:\n * // 1x + 2y = 5\n * // 3x + 4y = 6\n * const result = Matrix2x2.solveSystem(vector)(matrix)\n * ```\n * @param v - The vector representing the constants of the system.\n * @returns A function that takes a matrix and returns the solution vector.\n * @since 1.0.0\n */\n (v: Vector2): (m: Matrix2x2) => Vector2\n} = internal.solveSystem\n\n/**\n * Returns the rows of a matrix as an array of vectors.\n *\n * @param m - The matrix to convert.\n * @returns An array of vectors representing the rows of the matrix.\n * @since 1.0.0\n */\nexport const toRows: (m: Matrix2x2) => [Vector2, Vector2] = internal.toRows\n\n/**\n * Returns the columns of a matrix as an array of vectors.\n *\n * @param m - The matrix to convert.\n * @returns An array of vectors representing the columns of the matrix.\n * @since 1.0.0\n */\nexport const toColumns: (m: Matrix2x2) => [Vector2, Vector2] = internal.toColumns\n\n/**\n * Returns the specified row of a matrix as a vector.\n *\n * @param m - The matrix to get the row from.\n * @param row - The row index (0 or 1).\n * @returns A vector representing the specified row of the matrix.\n * @since 1.0.0\n */\nexport const rowVector: (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2 = internal.rowVector\n\n/**\n * Returns the specified column of a matrix as a vector.\n *\n * @param m - The matrix to get the column from.\n * @param column - The column index (0 or 1).\n * @returns A vector representing the specified column of the matrix.\n * @since 1.0.0\n */\nexport const columnVector: (m: Matrix2x2, column: Matrix2x2Coordinate) => Vector2 =\n internal.columnVector\n\n/**\n * Transposes a matrix.\n *\n * @param m - The matrix to transpose.\n * @returns A new `Matrix2x2` instance representing the transposed matrix.\n * @since 1.0.0\n */\nexport const transpose: (m: Matrix2x2) => Matrix2x2 = internal.transpose\n\n/**\n * Reverses the rows of a matrix.\n *\n * @param m - The matrix to reverse the rows of.\n * @returns A new `Matrix2x2` instance with the rows reversed.\n * @since 1.0.0\n */\nexport const reverseRows: (m: Matrix2x2) => Matrix2x2 = internal.reverseRows\n\n/**\n * Reverses the columns of a matrix.\n *\n * @param m - The matrix to reverse the columns of.\n * @returns A new `Matrix2x2` instance with the columns reversed.\n * @since 1.0.0\n */\nexport const reverseColumns: (m: Matrix2x2) => Matrix2x2 = internal.reverseColumns\n","import type { ThreeDimensionalComponent, ThreeDimensionalIndex } from '../dimensions.ts'\nimport type { Pipeable } from '../utils.ts'\nimport type { Vector3 } from '../vector/vector3.ts'\nimport type { Matrix2x2 } from './matrix2x2.ts'\nimport type { Matrix3x3TypeId } from './matrix3x3.internal.ts'\nimport * as internal from './matrix3x3.internal.ts'\n\n/**\n * A coordinate in a 3x3 matrix.\n *\n * @since 1.0.0\n */\nexport type Matrix3x3Coordinate = ThreeDimensionalIndex | ThreeDimensionalComponent\n\n/**\n * A 3x3 matrix.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Matrix3x3 extends Pipeable {\n readonly [Matrix3x3TypeId]: Matrix3x3TypeId\n /**\n * The value of the first row and first column.\n */\n readonly m00: number\n /**\n * The value of the first row and second column.\n */\n readonly m01: number\n /**\n * The value of the first row and third column.\n */\n readonly m02: number\n /**\n * The value of the second row and first column.\n */\n readonly m10: number\n /**\n * The value of the second row and second column.\n */\n readonly m11: number\n /**\n * The value of the second row and third column.\n */\n readonly m12: number\n /**\n * The value of the third row and first column.\n */\n readonly m20: number\n /**\n * The value of the third row and second column.\n */\n readonly m21: number\n /**\n * The value of the third row and third column.\n */\n readonly m22: number\n}\n\n/**\n * Checks if a value is a `Matrix3x3`.\n *\n * @param m - The value to check.\n * @returns `true` if the value is a `Matrix3x3`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isMatrix3x3: (m: unknown) => m is Matrix3x3 = internal.isMatrix3x3\n\nexport const equals: {\n /**\n * Checks if two `Matrix3x3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Matrix3x3, b: Matrix3x3): boolean\n /**\n * Checks if two `Matrix3x3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second matrix.\n * @returns A function that takes the first matrix and returns the comparison result.\n * @since 1.1.0\n */\n (b: Matrix3x3): (a: Matrix3x3) => boolean\n} = internal.equals\n\n/**\n * Creates a new `Matrix3x3` instance.\n *\n * @param m00 - The value of the first row and first column.\n * @param m01 - The value of the first row and second column.\n * @param m02 - The value of the first row and third column.\n * @param m10 - The value of the second row and first column.\n * @param m11 - The value of the second row and second column.\n * @param m12 - The value of the second row and third column.\n * @param m20 - The value of the third row and first column.\n * @param m21 - The value of the third row and second column.\n * @param m22 - The value of the third row and third column.\n * @returns A new `Matrix3x3` instance.\n * @since 1.0.0\n */\nexport const make: (\n m00?: number,\n m01?: number,\n m02?: number,\n m10?: number,\n m11?: number,\n m12?: number,\n m20?: number,\n m21?: number,\n m22?: number,\n) => Matrix3x3 = internal.make\n\n/**\n * Creates a new `Matrix3x3` instance from three row vectors.\n *\n * @param v0 - The first row vector.\n * @param v1 - The second row vector.\n * @param v2 - The third row vector.\n * @returns A new `Matrix3x3` instance.\n * @since 1.0.0\n */\nexport const fromRows: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3 = internal.fromRows\n\n/**\n * Creates a new `Matrix3x3` instance from three column vectors.\n *\n * @param v0 - The first column vector.\n * @param v1 - The second column vector.\n * @param v2 - The third column vector.\n * @returns A new `Matrix3x3` instance.\n * @since 1.0.0\n */\nexport const fromColumns: (v0: Vector3, v1: Vector3, v2: Vector3) => Matrix3x3 =\n internal.fromColumns\n\nexport const setRow: {\n /**\n * Sets a row of the matrix to a new vector.\n *\n * @param m - The matrix to set the row of.\n * @param row - The row index to set.\n * @param v - The new vector for the row.\n * @returns A new matrix with the specified row set to the new vector.\n * @since 1.0.0\n */\n (m: Matrix3x3, row: Matrix3x3Coordinate, v: Vector3): Matrix3x3\n /**\n * Sets a row of the matrix to a new vector.\n *\n * @param row - The row index to set.\n * @param v - The new vector for the row.\n * @returns A function that takes a matrix and returns a new matrix with the specified row set to the new vector.\n * @since 1.0.0\n */\n (row: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3\n} = internal.setRow\n\nexport const setColumn: {\n /**\n * Sets a column of the matrix to a new vector.\n *\n * @param m - The matrix to set the column of.\n * @param column - The column index to set.\n * @param v - The new vector for the column.\n * @returns A new matrix with the specified column set to the new vector.\n * @since 1.0.0\n */\n (m: Matrix3x3, column: Matrix3x3Coordinate, v: Vector3): Matrix3x3\n /**\n * Sets a column of the matrix to a new vector.\n *\n * @param column - The column index to set.\n * @param v - The new vector for the column.\n * @returns A function that takes a matrix and returns a new matrix with the specified column set to the new vector.\n * @since 1.0.0\n */\n (column: Matrix3x3Coordinate, v: Vector3): (m: Matrix3x3) => Matrix3x3\n} = internal.setColumn\n\n/**\n * Calculates the determinant of a 3x3 matrix.\n *\n * @param m - The matrix to calculate the determinant of.\n * @returns The determinant of the matrix.\n * @since 1.0.0\n */\nexport const determinant: (m: Matrix3x3) => number = internal.determinant\n\n/**\n * Calculates the minor of a 3x3 matrix.\n *\n * @param m - The matrix to calculate the minor of.\n * @param row - The row index of the element to calculate the minor for.\n * @param column - The column index of the element to calculate the minor for.\n * @returns The minor of the matrix at the specified row and column.\n * @since 1.0.0\n */\nexport const minor: (\n m: Matrix3x3,\n row: Matrix3x3Coordinate,\n column: Matrix3x3Coordinate,\n) => Matrix2x2 = internal.minor\n\nexport const vectorProductLeft: {\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 2 * 11 + 3 * 12\n * // y = 4 * 10 + 5 * 11 + 6 * 12\n * // z = 7 * 10 + 8 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductLeft(m, v)\n * ```\n * @param m - The matrix to calculate the left vector product with.\n * @param v - The vector to calculate the left vector product with.\n * @returns The resulting vector from the left vector product.\n * @since 1.0.0\n */\n (m: Matrix3x3, v: Vector3): Vector3\n /**\n * Calculates the left vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 2 * 11 + 3 * 12\n * // y = 4 * 10 + 5 * 11 + 6 * 12\n * // z = 7 * 10 + 8 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductLeft(v)(m)\n * ```\n * @param v - The vector to calculate the left vector product with.\n * @returns A function that takes a matrix and returns the resulting vector from the left vector product.\n * @since 1.0.0\n */\n (v: Vector3): (m: Matrix3x3) => Vector3\n} = internal.vectorProductLeft\n\nexport const vectorProductRight: {\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 4 * 11 + 7 * 12\n * // y = 2 * 10 + 5 * 11 + 8 * 12\n * // z = 3 * 10 + 6 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductRight(m, v)\n * ```\n * @param m - The matrix to calculate the right vector product with.\n * @param v - The vector to calculate the right vector product with.\n * @returns The resulting vector from the right vector product.\n * @since 1.0.0\n */\n (m: Matrix3x3, v: Vector3): Vector3\n /**\n * Calculates the right vector product of a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = 1 * 10 + 4 * 11 + 7 * 12\n * // y = 2 * 10 + 5 * 11 + 8 * 12\n * // z = 3 * 10 + 6 * 11 + 9 * 12\n * const result = Matrix3x3.vectorProductRight(v)(m)\n * ```\n * @param v - The vector to calculate the right vector product with.\n * @returns A function that takes a matrix and returns the resulting vector from the right vector product.\n * @since 1.0.0\n */\n (v: Vector3): (m: Matrix3x3) => Vector3\n} = internal.vectorProductRight\n\nexport const solveSystem: {\n /**\n * Solves a system of equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = m00 * x + m01 * y + m02 * z\n * // y = m10 * x + m11 * y + m12 * z\n * // z = m20 * x + m21 * y + m22 * z\n * const result = Matrix3x3.solveSystem(m, v)\n * ```\n * @since 1.0.0\n */\n (m: Matrix3x3, v: Vector3): Vector3\n /**\n * Solves a system of equations represented by a matrix and a vector.\n *\n * @example\n * ```ts\n * import * as Matrix3x3 from 'curvy/matrix3x3'\n * import * as Vector3 from 'curvy/vector3'\n *\n * const m = Matrix3x3.make(1, 2, 3, 4, 5, 6, 7, 8, 9)\n * const v = Vector3.vector3(10, 11, 12)\n *\n * // Performs:\n * // x = m00 * x + m01 * y + m02 * z\n * // y = m10 * x + m11 * y + m12 * z\n * // z = m20 * x + m21 * y + m22 * z\n * const result = Matrix3x3.solveSystem(v)(m)\n * ```\n * @since 1.0.0\n */\n (v: Vector3): (m: Matrix3x3) => Vector3\n} = internal.solveSystem\n\n/**\n * Returns the rows of a `Matrix3x3` as an array of vectors.\n *\n * @param m - The matrix to get the rows from.\n * @returns An array of vectors representing the rows of the matrix.\n * @since 1.0.0\n */\nexport const toRows: (m: Matrix3x3) => [Vector3, Vector3, Vector3] = internal.toRows as (\n m: Matrix3x3,\n) => [Vector3, Vector3, Vector3]\n\n/**\n * Returns the columns of a `Matrix3x3` as an array of vectors.\n *\n * @param m - The matrix to get the columns from.\n * @returns An array of vectors representing the columns of the matrix.\n * @since 1.0.0\n */\nexport const toColumns: (m: Matrix3x3) => [Vector3, Vector3, Vector3] = internal.toColumns as (\n m: Matrix3x3,\n) => [Vector3, Vector3, Vector3]\n\nexport const rowVector: {\n /**\n * Gets a row vector from the matrix.\n *\n * @param m - The matrix to get the row vector from.\n * @param row - The row index to get the vector from.\n * @returns The row vector at the specified index.\n * @since 1.0.0\n */\n (m: Matrix3x3, row: Matrix3x3Coordinate): Vector3\n /**\n * Gets a row vector from the matrix.\n *\n * @param row - The row index to get the vector from.\n * @returns A function that takes a matrix and returns the row vector at the specified index.\n * @since 1.0.0\n */\n (row: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3\n} = internal.rowVector\n\nexport const columnVector: {\n /**\n * Gets a column vector from the matrix.\n *\n * @param m - The matrix to get the column vector from.\n * @param column - The column index to get the vector from.\n * @returns The column vector at the specified index.\n * @since 1.0.0\n */\n (m: Matrix3x3, column: Matrix3x3Coordinate): Vector3\n /**\n * Gets a column vector from the matrix.\n *\n * @param column - The column index to get the vector from.\n * @returns A function that takes a matrix and returns the column vector at the specified index.\n * @since 1.0.0\n */\n (column: Matrix3x3Coordinate): (m: Matrix3x3) => Vector3\n} = internal.columnVector\n\n/**\n * Transposes a `Matrix3x3`.\n *\n * @param m - The matrix to transpose.\n * @returns A new `Matrix3x3` instance that is the transpose of the input matrix.\n * @since 1.0.0\n */\nexport const transpose: (m: Matrix3x3) => Matrix3x3 = internal.transpose\n\n/**\n * Reverses the rows of a `Matrix3x3`.\n *\n * @param m - The matrix to reverse the rows of.\n * @returns A new `Matrix3x3` instance with the rows reversed.\n * @since 1.0.0\n */\nexport const reverseRows: (m: Matrix3x3) => Matrix3x3 = internal.reverseRows\n\n/**\n * Reverses the columns of a `Matrix3x3`.\n *\n * @param m - The matrix to reverse the columns of.\n * @returns A new `Matrix3x3` instance with the columns reversed.\n * @since 1.0.0\n */\nexport const reverseColumns: (m: Matrix3x3) => Matrix3x3 = internal.reverseColumns\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,cAA8CA;AAE3D,MAAaC,WAoBTC;;;;;;;;;AAUJ,MAAaC,SACXC;;;;;;;;;AAUF,MAAaC,aAAoDC;;;;;;;;;AAUjE,MAAaC,gBAAuDC;AAEpE,MAAaC,WAoBTC;AAEJ,MAAaC,cAoBTC;;;;;;;;AASJ,MAAaC,gBAAwCC;AAErD,MAAaC,sBA4CTC;AAEJ,MAAaC,uBA4CTC;AAEJ,MAAaC,gBA4CTC;;;;;;;;AASJ,MAAaC,WAA+CC;;;;;;;;AAS5D,MAAaC,cAAkDC;;;;;;;;;AAU/D,MAAaC,cAAiEC;;;;;;;;;AAU9E,MAAaC,iBACXC;;;;;;;;AASF,MAAaC,cAAyCC;;;;;;;;AAStD,MAAaC,gBAA2CC;;;;;;;;AASxD,MAAaC,mBAA8CC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClS3D,MAAa,cAA8CC;AAE3D,MAAa,SAoBTC;;;;;;;;;;;;;;;;AAiBJ,MAAa,OAUIC;;;;;;;;;;AAWjB,MAAa,WAAiEC;;;;;;;;;;AAW9E,MAAa,cACXC;AAEF,MAAa,SAoBTC;AAEJ,MAAa,YAoBTC;;;;;;;;AASJ,MAAa,cAAwCC;;;;;;;;;;AAWrD,MAAa,QAIIC;AAEjB,MAAa,oBA8CTC;AAEJ,MAAa,qBA8CTC;AAEJ,MAAa,cAyCTC;;;;;;;;AASJ,MAAa,SAAwDC;;;;;;;;AAWrE,MAAa,YAA2DC;AAIxE,MAAa,YAkBTC;AAEJ,MAAa,eAkBTC;;;;;;;;AASJ,MAAa,YAAyCC;;;;;;;;AAStD,MAAa,cAA2CC;;;;;;;;AASxD,MAAa,iBAA8CC"}