curvy 2.0.0-alpha.5 → 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.
- package/dist/characteristic/characteristic.d.ts +3 -3
- package/dist/characteristic/index.d.ts +1 -1
- package/dist/characteristic/index.mjs +1 -1
- package/dist/curve/cubic2d.d.ts +10 -14
- package/dist/curve/cubic2d.internal.d.ts +2 -0
- package/dist/curve/index.d.ts +8 -8
- package/dist/curve/index.mjs +1 -1
- package/dist/curve/linear2d.d.ts +11 -15
- package/dist/curve/linear2d.internal.d.ts +2 -0
- package/dist/curve/quadratic2d.d.ts +11 -15
- package/dist/curve/quadratic2d.internal.d.ts +2 -0
- package/dist/curve/rationalCubic2d.d.ts +63 -22
- package/dist/curve/rationalCubic2d.internal.d.ts +2 -0
- package/dist/interval/index.d.ts +4 -4
- package/dist/interval/index.mjs +2 -2
- package/dist/interval/interval.d.ts +1 -1
- package/dist/interval/interval.internal.d.ts +1 -0
- package/dist/interval/interval2d.d.ts +45 -8
- package/dist/interval/interval2d.internal.d.ts +2 -0
- package/dist/matrix/index.d.ts +6 -6
- package/dist/matrix/index.mjs +1 -1
- package/dist/matrix/index.mjs.map +1 -1
- package/dist/matrix/matrix2x2.d.ts +4 -8
- package/dist/matrix/matrix2x2.internal.d.ts +2 -0
- package/dist/matrix/matrix3x3.d.ts +5 -9
- package/dist/matrix/matrix3x3.internal.d.ts +4 -0
- package/dist/matrix/matrix4x4.d.ts +5 -9
- package/dist/matrix/matrix4x4.internal.d.ts +2 -0
- package/dist/number.mjs.map +1 -1
- package/dist/path/cubic2d.d.ts +119 -12
- package/dist/path/cubic2d.internal.d.ts +2 -0
- package/dist/path/index.d.ts +8 -8
- package/dist/path/index.mjs +413 -4
- package/dist/path/index.mjs.map +1 -1
- package/dist/path/linear2d.d.ts +122 -12
- package/dist/path/linear2d.internal.d.ts +2 -0
- package/dist/path/quadratic2d.d.ts +119 -12
- package/dist/path/quadratic2d.internal.d.ts +2 -0
- package/dist/path/rationalCubic2d.d.ts +5 -9
- package/dist/path/rationalCubic2d.internal.d.ts +2 -0
- package/dist/path/traits.d.ts +64 -0
- package/dist/polynomial/cubic.d.ts +10 -14
- package/dist/polynomial/cubic.internal.circular.d.ts +2 -0
- package/dist/polynomial/cubic.internal.d.ts +1 -0
- package/dist/polynomial/index.d.ts +6 -6
- package/dist/polynomial/index.mjs +2 -2
- package/dist/polynomial/linear.d.ts +9 -13
- package/dist/polynomial/linear.internal.d.ts +2 -0
- package/dist/polynomial/quadratic.d.ts +11 -15
- package/dist/polynomial/quadratic.internal.circular.d.ts +2 -0
- package/dist/polynomial/quadratic.internal.d.ts +1 -0
- package/dist/shared/{characteristic-DLlhja-I.mjs → characteristic-D9yZWCym.mjs} +3 -3
- package/dist/shared/characteristic-D9yZWCym.mjs.map +1 -0
- package/dist/shared/{cubic-CMonq6bg.mjs → cubic-BK8xjSkd.mjs} +79 -4
- package/dist/shared/cubic-BK8xjSkd.mjs.map +1 -0
- package/dist/shared/{interval-X1EYuf-T.mjs → interval-CqC3ZIqj.mjs} +40 -1
- package/dist/shared/interval-CqC3ZIqj.mjs.map +1 -0
- package/dist/shared/{interval2d-ca0J1NMr.mjs → interval2d-BMDmeL1M.mjs} +45 -4
- package/dist/shared/interval2d-BMDmeL1M.mjs.map +1 -0
- package/dist/shared/{matrix4x4-Ck2WROK-.mjs → matrix4x4-qyRufxfs.mjs} +62 -3
- package/dist/shared/matrix4x4-qyRufxfs.mjs.map +1 -0
- package/dist/shared/{quadratic-DyeMtvET.mjs → quadratic-CWXIRh42.mjs} +2 -2
- package/dist/shared/quadratic-CWXIRh42.mjs.map +1 -0
- package/dist/shared/{rationalCubic2d-Vw4qGPZj.mjs → rationalCubic2d-BZvT9s5N.mjs} +218 -5
- package/dist/shared/rationalCubic2d-BZvT9s5N.mjs.map +1 -0
- package/dist/shared/{rationalCubic2d-D658ltUM.mjs → rationalCubic2d-DaFTrUXw.mjs} +250 -36
- package/dist/shared/rationalCubic2d-DaFTrUXw.mjs.map +1 -0
- package/dist/shared/{solution-3TDATEMn.mjs → solution-UKGK826h.mjs} +22 -2
- package/dist/shared/solution-UKGK826h.mjs.map +1 -0
- package/dist/shared/{vector2-CCuJx1rX.mjs → vector2-CWU3cPB2.mjs} +12 -2
- package/dist/shared/vector2-CWU3cPB2.mjs.map +1 -0
- package/dist/shared/{vector2.internal-DU_E808S.mjs → vector2.internal-BL8hFl1c.mjs} +31 -2
- package/dist/shared/vector2.internal-BL8hFl1c.mjs.map +1 -0
- package/dist/shared/{vector3-C-qgKAjR.mjs → vector3-DmMm6pX8.mjs} +12 -2
- package/dist/shared/vector3-DmMm6pX8.mjs.map +1 -0
- package/dist/shared/{vector4-BhOKDhD5.mjs → vector4-oqPPp45j.mjs} +12 -2
- package/dist/shared/vector4-oqPPp45j.mjs.map +1 -0
- package/dist/shared/{vector4.internal-5XcaX12X.mjs → vector4.internal-BnnTjVIr.mjs} +45 -2
- package/dist/shared/vector4.internal-BnnTjVIr.mjs.map +1 -0
- package/dist/solution/index.d.ts +1 -3
- package/dist/solution/index.mjs +1 -1
- package/dist/solution/solution.d.ts +2 -2
- package/dist/solution/solution.internal.d.ts +2 -0
- package/dist/splines/basis2d.d.ts +5 -9
- package/dist/splines/basis2d.internal.d.ts +2 -0
- package/dist/splines/bezier2d.d.ts +6 -10
- package/dist/splines/bezier2d.internal.d.ts +2 -0
- package/dist/splines/cardinal2d.d.ts +5 -9
- package/dist/splines/cardinal2d.internal.d.ts +2 -0
- package/dist/splines/hermite2d.d.ts +5 -9
- package/dist/splines/hermite2d.internal.d.ts +2 -0
- package/dist/splines/index.d.ts +10 -10
- package/dist/splines/index.mjs +62 -8
- package/dist/splines/index.mjs.map +1 -1
- package/dist/splines/rationalBezier2d.d.ts +5 -9
- package/dist/splines/rationalBezier2d.internal.d.ts +2 -0
- package/dist/splines/util.d.ts +3 -3
- package/dist/vector/index.d.ts +6 -6
- package/dist/vector/index.mjs +3 -3
- package/dist/vector/vector2.d.ts +12 -9
- package/dist/vector/vector2.internal.d.ts +4 -0
- package/dist/vector/vector3.d.ts +12 -7
- package/dist/vector/vector3.internal.d.ts +2 -0
- package/dist/vector/vector4.d.ts +12 -7
- package/dist/vector/vector4.internal.d.ts +2 -0
- package/package.json +2 -2
- package/dist/shared/characteristic-DLlhja-I.mjs.map +0 -1
- package/dist/shared/cubic-CMonq6bg.mjs.map +0 -1
- package/dist/shared/interval-X1EYuf-T.mjs.map +0 -1
- package/dist/shared/interval2d-ca0J1NMr.mjs.map +0 -1
- package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +0 -1
- package/dist/shared/quadratic-DyeMtvET.mjs.map +0 -1
- package/dist/shared/rationalCubic2d-D658ltUM.mjs.map +0 -1
- package/dist/shared/rationalCubic2d-Vw4qGPZj.mjs.map +0 -1
- package/dist/shared/solution-3TDATEMn.mjs.map +0 -1
- package/dist/shared/vector2-CCuJx1rX.mjs.map +0 -1
- package/dist/shared/vector2.internal-DU_E808S.mjs.map +0 -1
- package/dist/shared/vector3-C-qgKAjR.mjs.map +0 -1
- package/dist/shared/vector4-BhOKDhD5.mjs.map +0 -1
- package/dist/shared/vector4.internal-5XcaX12X.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Matrix4x4 from '../matrix/matrix4x4';
|
|
2
|
-
import * as CubicPolynomial from '../polynomial/cubic';
|
|
3
|
-
import type * as Vector4 from '../vector/vector4';
|
|
1
|
+
import * as Matrix4x4 from '../matrix/matrix4x4.ts';
|
|
2
|
+
import * as CubicPolynomial from '../polynomial/cubic.ts';
|
|
3
|
+
import type * as Vector4 from '../vector/vector4.ts';
|
|
4
4
|
/**
|
|
5
5
|
* The cubic Bézier characteristic matrix.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Characteristic from './characteristic';
|
|
1
|
+
export * as Characteristic from './characteristic.ts';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as characteristic_exports } from "../shared/characteristic-
|
|
1
|
+
import { n as characteristic_exports } from "../shared/characteristic-D9yZWCym.mjs";
|
|
2
2
|
export { characteristic_exports as Characteristic };
|
package/dist/curve/cubic2d.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import type { Interval2d } from '../interval/interval2d';
|
|
2
|
-
import type { TwoDimensional } from '../dimensions';
|
|
3
|
-
import type { Closed, Interval } from '../interval/interval';
|
|
4
|
-
import type { Pipeable } from '../utils';
|
|
5
|
-
import type { CubicPolynomial } from '../polynomial/cubic';
|
|
6
|
-
import type { Decreasing, Increasing, Monotonic } from '../polynomial/traits';
|
|
7
|
-
import type * as Solution from '../solution/solution';
|
|
8
|
-
import type { Vector2 } from '../vector/vector2';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type CubicCurve2dTypeId = typeof CubicCurve2dTypeId;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits';
|
|
1
|
+
import type { Interval2d } from '../interval/interval2d.ts';
|
|
2
|
+
import type { TwoDimensional } from '../dimensions.ts';
|
|
3
|
+
import type { Closed, Interval } from '../interval/interval.ts';
|
|
4
|
+
import type { Pipeable } from '../utils.ts';
|
|
5
|
+
import type { CubicPolynomial } from '../polynomial/cubic.ts';
|
|
6
|
+
import type { Decreasing, Increasing, Monotonic } from '../polynomial/traits.ts';
|
|
7
|
+
import type * as Solution from '../solution/solution.ts';
|
|
8
|
+
import type { Vector2 } from '../vector/vector2.ts';
|
|
9
|
+
import type { CubicCurve2dTypeId } from './cubic2d.internal.ts';
|
|
10
|
+
export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits.ts';
|
|
15
11
|
/**
|
|
16
12
|
* A cubic curve in 2D space.
|
|
17
13
|
*
|
package/dist/curve/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as LinearCurve2dNs from './linear2d';
|
|
2
|
-
import * as QuadraticCurve2dNs from './quadratic2d';
|
|
3
|
-
import * as CubicCurve2dNs from './cubic2d';
|
|
4
|
-
import * as RationalCubicCurve2dNs from './rationalCubic2d';
|
|
1
|
+
import * as LinearCurve2dNs from './linear2d.ts';
|
|
2
|
+
import * as QuadraticCurve2dNs from './quadratic2d.ts';
|
|
3
|
+
import * as CubicCurve2dNs from './cubic2d.ts';
|
|
4
|
+
import * as RationalCubicCurve2dNs from './rationalCubic2d.ts';
|
|
5
|
+
export type LinearCurve2d<XTraits = unknown, YTraits = unknown> = LinearCurve2dNs.LinearCurve2d<XTraits, YTraits>;
|
|
5
6
|
export { LinearCurve2dNs as LinearCurve2d };
|
|
6
|
-
export type
|
|
7
|
+
export type QuadraticCurve2d<XTraits = unknown, YTraits = unknown> = QuadraticCurve2dNs.QuadraticCurve2d<XTraits, YTraits>;
|
|
7
8
|
export { QuadraticCurve2dNs as QuadraticCurve2d };
|
|
8
|
-
export type
|
|
9
|
+
export type CubicCurve2d<XTraits = unknown, YTraits = unknown> = CubicCurve2dNs.CubicCurve2d<XTraits, YTraits>;
|
|
9
10
|
export { CubicCurve2dNs as CubicCurve2d };
|
|
10
|
-
export type
|
|
11
|
+
export type RationalCubicCurve2d<XTraits = unknown, YTraits = unknown> = RationalCubicCurve2dNs.RationalCubicCurve2d<XTraits, YTraits>;
|
|
11
12
|
export { RationalCubicCurve2dNs as RationalCubicCurve2d };
|
|
12
|
-
export type RationalCubicCurve2d = RationalCubicCurve2dNs.RationalCubicCurve2d;
|
package/dist/curve/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as linear2d_exports, g as quadratic2d_exports, o as cubic2d_exports, r as rationalCubic2d_exports } from "../shared/rationalCubic2d-DaFTrUXw.mjs";
|
|
2
2
|
export { cubic2d_exports as CubicCurve2d, linear2d_exports as LinearCurve2d, quadratic2d_exports as QuadraticCurve2d, rationalCubic2d_exports as RationalCubicCurve2d };
|
package/dist/curve/linear2d.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import type { Interval2d } from '../interval/interval2d';
|
|
2
|
-
import type { TwoDimensional } from '../dimensions';
|
|
3
|
-
import type { Closed, Interval } from '../interval/interval';
|
|
4
|
-
import type { Pipeable } from '../utils';
|
|
5
|
-
import type { LinearPolynomial } from '../polynomial/linear';
|
|
6
|
-
import type { Decreasing, Increasing, Monotonic } from '../polynomial/traits';
|
|
7
|
-
import type * as Solution from '../solution/solution';
|
|
8
|
-
import type { Vector2 } from '../vector/vector2';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type LinearCurve2dTypeId = typeof LinearCurve2dTypeId;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits';
|
|
1
|
+
import type { Interval2d } from '../interval/interval2d.ts';
|
|
2
|
+
import type { TwoDimensional } from '../dimensions.ts';
|
|
3
|
+
import type { Closed, Interval } from '../interval/interval.ts';
|
|
4
|
+
import type { Pipeable } from '../utils.ts';
|
|
5
|
+
import type { LinearPolynomial } from '../polynomial/linear.ts';
|
|
6
|
+
import type { Decreasing, Increasing, Monotonic } from '../polynomial/traits.ts';
|
|
7
|
+
import type * as Solution from '../solution/solution.ts';
|
|
8
|
+
import type { Vector2 } from '../vector/vector2.ts';
|
|
9
|
+
import type { LinearCurve2dTypeId } from './linear2d.internal.ts';
|
|
10
|
+
export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits.ts';
|
|
15
11
|
/**
|
|
16
12
|
* A linear curve in 2D space.
|
|
17
13
|
*
|
|
@@ -60,7 +56,7 @@ export declare const fromCoefficients: (c0: Vector2, c1: Vector2) => LinearCurve
|
|
|
60
56
|
* @returns A new `LinearCurve2d` instance whose curve matches the line from `p0` to `p1`.
|
|
61
57
|
* @since 2.0.0
|
|
62
58
|
*/
|
|
63
|
-
export declare const
|
|
59
|
+
export declare const fromEndpoints: (p0: Vector2, p1: Vector2) => LinearCurve2d;
|
|
64
60
|
/**
|
|
65
61
|
* Checks if a value is a `LinearCurve2d`.
|
|
66
62
|
*
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import type { Interval2d } from '../interval/interval2d';
|
|
2
|
-
import type { TwoDimensional } from '../dimensions';
|
|
3
|
-
import type { Closed, Interval } from '../interval/interval';
|
|
4
|
-
import type { Pipeable } from '../utils';
|
|
5
|
-
import type { QuadraticPolynomial } from '../polynomial/quadratic';
|
|
6
|
-
import type { Decreasing, Increasing, Monotonic } from '../polynomial/traits';
|
|
7
|
-
import type * as Solution from '../solution/solution';
|
|
8
|
-
import type { Vector2 } from '../vector/vector2';
|
|
9
|
-
import type { LinearCurve2d } from './linear2d';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type QuadraticCurve2dTypeId = typeof QuadraticCurve2dTypeId;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits';
|
|
1
|
+
import type { Interval2d } from '../interval/interval2d.ts';
|
|
2
|
+
import type { TwoDimensional } from '../dimensions.ts';
|
|
3
|
+
import type { Closed, Interval } from '../interval/interval.ts';
|
|
4
|
+
import type { Pipeable } from '../utils.ts';
|
|
5
|
+
import type { QuadraticPolynomial } from '../polynomial/quadratic.ts';
|
|
6
|
+
import type { Decreasing, Increasing, Monotonic } from '../polynomial/traits.ts';
|
|
7
|
+
import type * as Solution from '../solution/solution.ts';
|
|
8
|
+
import type { Vector2 } from '../vector/vector2.ts';
|
|
9
|
+
import type { LinearCurve2d } from './linear2d.ts';
|
|
10
|
+
import type { QuadraticCurve2dTypeId } from './quadratic2d.internal.ts';
|
|
11
|
+
export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits.ts';
|
|
16
12
|
/**
|
|
17
13
|
* A quadratic curve in 2D space.
|
|
18
14
|
*
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
5
|
-
import type {
|
|
6
|
-
import type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type RationalCubicCurve2dTypeId
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type { Decreasing, Increasing, Monotonic } from '../polynomial/traits';
|
|
15
|
-
export { RationalCurveTraits } from './rationalCubic2d.internal';
|
|
1
|
+
import type { Closed } from '../interval/interval.ts';
|
|
2
|
+
import type { Interval2d } from '../interval/interval2d.ts';
|
|
3
|
+
import type { Pipeable } from '../utils.ts';
|
|
4
|
+
import type { CubicPolynomial } from '../polynomial/cubic.ts';
|
|
5
|
+
import type { Increasing, Monotonic } from '../polynomial/traits.ts';
|
|
6
|
+
import type * as Solution from '../solution/solution.ts';
|
|
7
|
+
import type { Vector2, Weighted } from '../vector/vector2.ts';
|
|
8
|
+
import type { CubicCurve2d } from './cubic2d.ts';
|
|
9
|
+
import type { RationalCubicCurve2dTypeId, RationalCurveTraits } from './rationalCubic2d.internal.ts';
|
|
10
|
+
export type { Decreasing, Increasing, Monotonic } from '../polynomial/traits.ts';
|
|
11
|
+
export { RationalCurveTraits } from './rationalCubic2d.internal.ts';
|
|
16
12
|
/**
|
|
17
13
|
* A rational cubic curve in 2D space.
|
|
18
14
|
*
|
|
@@ -172,19 +168,64 @@ export declare const solveAtY: {
|
|
|
172
168
|
<XT, YT>(c: RationalCubicCurve2d<XT, YT>): Solution.AtMostThree<number>;
|
|
173
169
|
};
|
|
174
170
|
};
|
|
171
|
+
export declare const subdivide: {
|
|
172
|
+
/**
|
|
173
|
+
* Subdivides a rational cubic curve at parameter `t ∈ (0, 1)` into two new
|
|
174
|
+
* rational cubic curves. The first curve's evaluation on `[0, 1]` matches
|
|
175
|
+
* the original's on `[0, t]`; the second matches the original's on `[t, 1]`.
|
|
176
|
+
* Equivalent to de Casteljau subdivision on the homogeneous control polygon,
|
|
177
|
+
* but performed directly on the per-axis monomial polynomials.
|
|
178
|
+
*
|
|
179
|
+
* @param c - The rational cubic curve to subdivide.
|
|
180
|
+
* @param t - The split parameter; must be in the open interval `(0, 1)`.
|
|
181
|
+
* @returns A `[left, right]` tuple of rational cubic curves.
|
|
182
|
+
* @since 2.0.0
|
|
183
|
+
*/
|
|
184
|
+
(c: RationalCubicCurve2d, t: number): [RationalCubicCurve2d, RationalCubicCurve2d];
|
|
185
|
+
/**
|
|
186
|
+
* Subdivides a rational cubic curve at parameter `t ∈ (0, 1)`.
|
|
187
|
+
*
|
|
188
|
+
* @param t - The split parameter; must be in the open interval `(0, 1)`.
|
|
189
|
+
* @returns A function that takes a curve and returns its `[left, right]` halves.
|
|
190
|
+
* @since 2.0.0
|
|
191
|
+
*/
|
|
192
|
+
(t: number): (c: RationalCubicCurve2d) => [RationalCubicCurve2d, RationalCubicCurve2d];
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Computes a closed axis-aligned bounding box for a rational cubic curve from
|
|
196
|
+
* its projected control polygon. Looser than the tight extrema-based box used
|
|
197
|
+
* by `CubicCurve2d.boundingBox` — finding tight extrema of `x(t)/w(t)` and
|
|
198
|
+
* `y(t)/w(t)` requires solving degree-5 polynomials — but always valid: a
|
|
199
|
+
* positive-weight rational Bézier curve lies inside the convex hull of its
|
|
200
|
+
* projected control points, so the AABB of those points contains the curve.
|
|
201
|
+
*
|
|
202
|
+
* Suitable for subdivision-based geometric queries, where bound looseness is
|
|
203
|
+
* compensated by recursion depth.
|
|
204
|
+
*
|
|
205
|
+
* @param c - The rational cubic curve.
|
|
206
|
+
* @returns A closed `Interval2d` enclosing the curve.
|
|
207
|
+
* @since 2.0.0
|
|
208
|
+
*/
|
|
209
|
+
export declare const boundingBox: (c: RationalCubicCurve2d) => Interval2d<Closed, Closed>;
|
|
175
210
|
export declare const approximateAsCubicCurves: {
|
|
176
211
|
/**
|
|
177
212
|
* Approximates the rational cubic as a sequence of polynomial cubic curves
|
|
178
213
|
* via recursive subdivision. At each level a candidate polynomial cubic is
|
|
179
214
|
* built by projecting the segment's homogeneous Bézier control points to
|
|
180
|
-
* 2D; if the
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
215
|
+
* 2D; if the symmetric Hausdorff distance between the rational segment and
|
|
216
|
+
* its candidate exceeds `tolerance` (verified via a certified subdivision
|
|
217
|
+
* bound, not a single-point sample), the segment is split at `t = 0.5` and
|
|
218
|
+
* the procedure recurses on each half. Returns a non-empty array; for a
|
|
219
|
+
* curve that is already polynomial (uniform weights) the result is a
|
|
220
|
+
* single exact segment.
|
|
221
|
+
*
|
|
222
|
+
* The Hausdorff guarantee means: every point on the rational lies within
|
|
223
|
+
* `tolerance` of some output segment, and every point on the output lies
|
|
224
|
+
* within `tolerance` of the rational — a true two-sided bound on geometric
|
|
225
|
+
* deviation, not just a parametric error at one sample.
|
|
185
226
|
*
|
|
186
227
|
* @param c - The rational cubic curve to approximate.
|
|
187
|
-
* @param tolerance - Maximum allowed
|
|
228
|
+
* @param tolerance - Maximum allowed Hausdorff distance; must be positive.
|
|
188
229
|
* @returns A sequence of polynomial cubic curves covering the input.
|
|
189
230
|
* @since 2.0.0
|
|
190
231
|
*/
|
|
@@ -192,7 +233,7 @@ export declare const approximateAsCubicCurves: {
|
|
|
192
233
|
/**
|
|
193
234
|
* Approximates the rational cubic as a sequence of polynomial cubic curves.
|
|
194
235
|
*
|
|
195
|
-
* @param tolerance - Maximum allowed
|
|
236
|
+
* @param tolerance - Maximum allowed Hausdorff distance; must be positive.
|
|
196
237
|
* @returns A function that takes a curve and returns its polynomial approximation.
|
|
197
238
|
* @since 2.0.0
|
|
198
239
|
*/
|
package/dist/interval/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as IntervalNs from './interval';
|
|
2
|
-
import * as Interval2dNs from './interval2d';
|
|
3
|
-
export { IntervalNs as Interval };
|
|
1
|
+
import * as IntervalNs from './interval.ts';
|
|
2
|
+
import * as Interval2dNs from './interval2d.ts';
|
|
4
3
|
export type Interval = IntervalNs.Interval;
|
|
4
|
+
export { IntervalNs as Interval };
|
|
5
|
+
export type Interval2d<X extends IntervalNs.Interval = IntervalNs.Interval, Y extends IntervalNs.Interval = IntervalNs.Interval> = Interval2dNs.Interval2d<X, Y>;
|
|
5
6
|
export { Interval2dNs as Interval2d };
|
|
6
|
-
export type Interval2d = Interval2dNs.Interval2d;
|
package/dist/interval/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { s as interval_exports } from "../shared/interval-
|
|
2
|
-
import {
|
|
1
|
+
import { s as interval_exports } from "../shared/interval-CqC3ZIqj.mjs";
|
|
2
|
+
import { n as interval2d_exports } from "../shared/interval2d-BMDmeL1M.mjs";
|
|
3
3
|
export { interval_exports as Interval, interval2d_exports as Interval2d };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { Pipeable } from '../utils';
|
|
2
|
-
import type { Vector2 } from '../vector/vector2';
|
|
3
|
-
import type { Bounds, Closed, Interval } from './interval';
|
|
4
|
-
|
|
5
|
-
declare const Interval2dTypeId: unique symbol;
|
|
6
|
-
type Interval2dTypeId = typeof Interval2dTypeId;
|
|
7
|
-
|
|
8
|
-
|
|
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';
|
|
9
5
|
/**
|
|
10
6
|
* An axis-aligned 2D interval — the Cartesian product of two 1D intervals.
|
|
11
7
|
* Used as a bounding box for curves and paths, and as a region for
|
|
@@ -165,3 +161,44 @@ export declare const equals: {
|
|
|
165
161
|
*/
|
|
166
162
|
(b: Interval2d): (a: Interval2d) => boolean;
|
|
167
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
|
+
};
|
package/dist/matrix/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as Matrix2x2Ns from './matrix2x2';
|
|
2
|
-
import * as Matrix3x3Ns from './matrix3x3';
|
|
3
|
-
import * as Matrix4x4Ns from './matrix4x4';
|
|
4
|
-
export { Matrix2x2Ns as Matrix2x2 };
|
|
1
|
+
import * as Matrix2x2Ns from './matrix2x2.ts';
|
|
2
|
+
import * as Matrix3x3Ns from './matrix3x3.ts';
|
|
3
|
+
import * as Matrix4x4Ns from './matrix4x4.ts';
|
|
5
4
|
export type Matrix2x2 = Matrix2x2Ns.Matrix2x2;
|
|
6
|
-
export {
|
|
5
|
+
export { Matrix2x2Ns as Matrix2x2 };
|
|
7
6
|
export type Matrix3x3 = Matrix3x3Ns.Matrix3x3;
|
|
8
|
-
export {
|
|
7
|
+
export { Matrix3x3Ns as Matrix3x3 };
|
|
9
8
|
export type Matrix4x4 = Matrix4x4Ns.Matrix4x4;
|
|
9
|
+
export { Matrix4x4Ns as Matrix4x4 };
|
package/dist/matrix/index.mjs
CHANGED
|
@@ -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-
|
|
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"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { TwoDimensionalComponent, TwoDimensionalIndex } from '../dimensions';
|
|
2
|
-
import type { Pipeable } from '../utils';
|
|
3
|
-
import type { Vector2 } from '../vector/vector2';
|
|
4
|
-
|
|
5
|
-
declare const Matrix2x2TypeId: unique symbol;
|
|
6
|
-
type Matrix2x2TypeId = typeof Matrix2x2TypeId;
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { TwoDimensionalComponent, TwoDimensionalIndex } from '../dimensions.ts';
|
|
2
|
+
import type { Pipeable } from '../utils.ts';
|
|
3
|
+
import type { Vector2 } from '../vector/vector2.ts';
|
|
4
|
+
import type { Matrix2x2TypeId } from './matrix2x2.internal.ts';
|
|
9
5
|
/**
|
|
10
6
|
* A type representing the coordinate of a 2D matrix.
|
|
11
7
|
*
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import type { ThreeDimensionalComponent, ThreeDimensionalIndex } from '../dimensions';
|
|
2
|
-
import type { Pipeable } from '../utils';
|
|
3
|
-
import type { Vector3 } from '../vector/vector3';
|
|
4
|
-
import type { Matrix2x2 } from './matrix2x2';
|
|
5
|
-
|
|
6
|
-
declare const Matrix3x3TypeId: unique symbol;
|
|
7
|
-
type Matrix3x3TypeId = typeof Matrix3x3TypeId;
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { ThreeDimensionalComponent, ThreeDimensionalIndex } from '../dimensions.ts';
|
|
2
|
+
import type { Pipeable } from '../utils.ts';
|
|
3
|
+
import type { Vector3 } from '../vector/vector3.ts';
|
|
4
|
+
import type { Matrix2x2 } from './matrix2x2.ts';
|
|
5
|
+
import type { Matrix3x3TypeId } from './matrix3x3.internal.ts';
|
|
10
6
|
/**
|
|
11
7
|
* A coordinate in a 3x3 matrix.
|
|
12
8
|
*
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import type { FourDimensionalComponent, FourDimensionalIndex } from '../dimensions';
|
|
2
|
-
import type { Pipeable } from '../utils';
|
|
3
|
-
import type { Vector4 } from '../vector/vector4';
|
|
4
|
-
import type { Matrix3x3 } from './matrix3x3';
|
|
5
|
-
|
|
6
|
-
declare const Matrix4x4TypeId: unique symbol;
|
|
7
|
-
type Matrix4x4TypeId = typeof Matrix4x4TypeId;
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { FourDimensionalComponent, FourDimensionalIndex } from '../dimensions.ts';
|
|
2
|
+
import type { Pipeable } from '../utils.ts';
|
|
3
|
+
import type { Vector4 } from '../vector/vector4.ts';
|
|
4
|
+
import type { Matrix3x3 } from './matrix3x3.ts';
|
|
5
|
+
import type { Matrix4x4TypeId } from './matrix4x4.internal.ts';
|
|
10
6
|
/**
|
|
11
7
|
* A coordinate in a 4x4 matrix.
|
|
12
8
|
*
|