curvy 2.0.0-alpha.14 → 2.0.0-alpha.16

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 (103) hide show
  1. package/dist/characteristic/characteristic.d.ts +21 -22
  2. package/dist/characteristic/index.mjs +1 -1
  3. package/dist/curve/cubic2d.d.ts +143 -59
  4. package/dist/curve/curve2d.d.ts +6 -6
  5. package/dist/curve/index.mjs +1 -1
  6. package/dist/curve/linear2d.d.ts +109 -65
  7. package/dist/curve/quadratic2d.d.ts +132 -51
  8. package/dist/curve/rationalCubic2d.d.ts +102 -62
  9. package/dist/dimensions.d.ts +42 -0
  10. package/dist/interval/index.mjs +2 -2
  11. package/dist/interval/interval.d.ts +190 -71
  12. package/dist/interval/interval2d.d.ts +65 -31
  13. package/dist/matrix/index.mjs +58 -41
  14. package/dist/matrix/index.mjs.map +1 -1
  15. package/dist/matrix/matrix2x2.d.ts +82 -114
  16. package/dist/matrix/matrix3x3.d.ts +111 -137
  17. package/dist/matrix/matrix4x4.d.ts +96 -102
  18. package/dist/matrix/traits.d.ts +10 -6
  19. package/dist/monotonicity/index.mjs +1 -1
  20. package/dist/monotonicity/monotonicity.d.ts +35 -28
  21. package/dist/number.d.ts +155 -131
  22. package/dist/number.mjs +77 -62
  23. package/dist/number.mjs.map +1 -1
  24. package/dist/path/cubic2d.d.ts +110 -43
  25. package/dist/path/index.mjs +72 -26
  26. package/dist/path/index.mjs.map +1 -1
  27. package/dist/path/linear2d.d.ts +99 -40
  28. package/dist/path/path2d.d.ts +6 -4
  29. package/dist/path/quadratic2d.d.ts +101 -34
  30. package/dist/path/rationalCubic2d.d.ts +26 -21
  31. package/dist/path/traits.d.ts +4 -4
  32. package/dist/polynomial/cubic.d.ts +150 -86
  33. package/dist/polynomial/index.mjs +2 -2
  34. package/dist/polynomial/linear.d.ts +114 -70
  35. package/dist/polynomial/quadratic.d.ts +143 -77
  36. package/dist/polynomial/traits.d.ts +5 -5
  37. package/dist/shared/{affine2d-Dvna84gc.mjs → affine2d-Bpn5tc1u.mjs} +46 -43
  38. package/dist/shared/affine2d-Bpn5tc1u.mjs.map +1 -0
  39. package/dist/shared/{characteristic--7nC4Q_a.mjs → characteristic-DQNPi4wd.mjs} +24 -25
  40. package/dist/shared/characteristic-DQNPi4wd.mjs.map +1 -0
  41. package/dist/shared/{cubic-BiGuAnZ0.mjs → cubic-Bly8kxxo.mjs} +58 -25
  42. package/dist/shared/cubic-Bly8kxxo.mjs.map +1 -0
  43. package/dist/shared/{interval-Dcqpo73t.mjs → interval-Dv6eHXJH.mjs} +107 -37
  44. package/dist/shared/interval-Dv6eHXJH.mjs.map +1 -0
  45. package/dist/shared/{interval2d-C2Pk66-2.mjs → interval2d-B8wt0szh.mjs} +14 -10
  46. package/dist/shared/interval2d-B8wt0szh.mjs.map +1 -0
  47. package/dist/shared/{matrix3x3.internal-Cod-r7H3.mjs → matrix3x3.internal-CFbYATcm.mjs} +2 -2
  48. package/dist/shared/matrix3x3.internal-CFbYATcm.mjs.map +1 -0
  49. package/dist/shared/{matrix4x4-BrqgYZCD.mjs → matrix4x4-DNcb1l5T.mjs} +34 -20
  50. package/dist/shared/matrix4x4-DNcb1l5T.mjs.map +1 -0
  51. package/dist/shared/{monotonicity-DNxBoC7F.mjs → monotonicity-C-lodqfb.mjs} +23 -13
  52. package/dist/shared/monotonicity-C-lodqfb.mjs.map +1 -0
  53. package/dist/shared/{quadratic-BmMqkvxx.mjs → quadratic-BBQDu0at.mjs} +85 -44
  54. package/dist/shared/quadratic-BBQDu0at.mjs.map +1 -0
  55. package/dist/shared/{rationalCubic2d-bveuGqBZ.mjs → rationalCubic2d-D9bMCQ8P.mjs} +152 -62
  56. package/dist/shared/rationalCubic2d-D9bMCQ8P.mjs.map +1 -0
  57. package/dist/shared/{rationalCubic2d-CZSwwKtS.mjs → rationalCubic2d-D_TBd-3i.mjs} +395 -203
  58. package/dist/shared/rationalCubic2d-D_TBd-3i.mjs.map +1 -0
  59. package/dist/shared/{solution-BW0BBMXI.mjs → solution-Cgq_KclT.mjs} +52 -79
  60. package/dist/shared/solution-Cgq_KclT.mjs.map +1 -0
  61. package/dist/shared/{vector2-DuA3EmfL.mjs → vector2-CrUOYb3v.mjs} +60 -30
  62. package/dist/shared/vector2-CrUOYb3v.mjs.map +1 -0
  63. package/dist/shared/{vector3-oxtggkDp.mjs → vector3-CFL7Yx16.mjs} +67 -36
  64. package/dist/shared/vector3-CFL7Yx16.mjs.map +1 -0
  65. package/dist/shared/vector3.internal-CfWHl9SG.mjs.map +1 -1
  66. package/dist/shared/{vector4-DGHuCvTV.mjs → vector4-syi93IOY.mjs} +41 -30
  67. package/dist/shared/vector4-syi93IOY.mjs.map +1 -0
  68. package/dist/solution/index.mjs +1 -1
  69. package/dist/solution/solution.d.ts +201 -93
  70. package/dist/splines/basis2d.d.ts +1 -1
  71. package/dist/splines/bezier2d.d.ts +109 -60
  72. package/dist/splines/cardinal2d.d.ts +52 -36
  73. package/dist/splines/hermite2d.d.ts +6 -6
  74. package/dist/splines/index.mjs +30 -28
  75. package/dist/splines/index.mjs.map +1 -1
  76. package/dist/splines/linear2d.d.ts +3 -3
  77. package/dist/splines/rationalBezier2d.d.ts +25 -24
  78. package/dist/transform/affine2d.d.ts +61 -57
  79. package/dist/transform/index.mjs +1 -1
  80. package/dist/transform/traits.d.ts +3 -3
  81. package/dist/utils.d.ts +114 -11
  82. package/dist/utils.mjs +49 -10
  83. package/dist/utils.mjs.map +1 -1
  84. package/dist/vector/index.mjs +3 -3
  85. package/dist/vector/vector2.d.ts +141 -74
  86. package/dist/vector/vector3.d.ts +114 -60
  87. package/dist/vector/vector4.d.ts +68 -50
  88. package/package.json +1 -1
  89. package/dist/shared/affine2d-Dvna84gc.mjs.map +0 -1
  90. package/dist/shared/characteristic--7nC4Q_a.mjs.map +0 -1
  91. package/dist/shared/cubic-BiGuAnZ0.mjs.map +0 -1
  92. package/dist/shared/interval-Dcqpo73t.mjs.map +0 -1
  93. package/dist/shared/interval2d-C2Pk66-2.mjs.map +0 -1
  94. package/dist/shared/matrix3x3.internal-Cod-r7H3.mjs.map +0 -1
  95. package/dist/shared/matrix4x4-BrqgYZCD.mjs.map +0 -1
  96. package/dist/shared/monotonicity-DNxBoC7F.mjs.map +0 -1
  97. package/dist/shared/quadratic-BmMqkvxx.mjs.map +0 -1
  98. package/dist/shared/rationalCubic2d-CZSwwKtS.mjs.map +0 -1
  99. package/dist/shared/rationalCubic2d-bveuGqBZ.mjs.map +0 -1
  100. package/dist/shared/solution-BW0BBMXI.mjs.map +0 -1
  101. package/dist/shared/vector2-DuA3EmfL.mjs.map +0 -1
  102. package/dist/shared/vector3-oxtggkDp.mjs.map +0 -1
  103. package/dist/shared/vector4-DGHuCvTV.mjs.map +0 -1
@@ -4,10 +4,11 @@ import type * as Vector4 from '../vector/vector4.ts';
4
4
  /**
5
5
  * The cubic Bézier characteristic matrix.
6
6
  *
7
- * Maps Bernstein-basis control points `(P₀, P₁, P₂, P₃)` to monomial cubic
8
- * coefficients `(c₀, c₁, c₂, c₃)` for `c₀ + c₁·t + c₂·t² + c₃·t³`. The matrix
9
- * IS the Bézier spline family — combined with control points (via {@link apply}),
10
- * it produces the cubic polynomial that parameterizes the curve.
7
+ * Maps Bernstein-basis control points `(P0, P1, P2, P3)` to monomial cubic
8
+ * coefficients `(c0, c1, c2, c3)` for `c0 + c1*t + c2*t^2 + c3*t^3`. The
9
+ * matrix is the spline family's defining data. Combined with control
10
+ * points via `apply`, it produces the cubic polynomial that parameterizes
11
+ * the curve.
11
12
  *
12
13
  * @since 2.0.0
13
14
  */
@@ -15,8 +16,8 @@ export declare const cubicBezier: Matrix4x4.Matrix4x4;
15
16
  /**
16
17
  * The cubic Hermite characteristic matrix.
17
18
  *
18
- * Maps Hermite control data `(P₀, V₀, P₁, V₁)` — two endpoints and two
19
- * tangent vectors — to monomial cubic coefficients.
19
+ * Maps Hermite control data `(P0, V0, P1, V1)`, two endpoints and two
20
+ * tangent vectors, to monomial cubic coefficients.
20
21
  *
21
22
  * @since 2.0.0
22
23
  */
@@ -26,7 +27,7 @@ export declare const cubicHermite: Matrix4x4.Matrix4x4;
26
27
  *
27
28
  * Maps a window of four control points to the monomial cubic coefficients
28
29
  * of one segment of the corresponding uniform cubic B-spline. Stride-1
29
- * application produces a C² piecewise spline; the curve does not generally
30
+ * application produces a C2 piecewise spline. The curve does not generally
30
31
  * pass through the control points.
31
32
  *
32
33
  * @since 2.0.0
@@ -36,24 +37,22 @@ export declare const cubicBasisSpline: Matrix4x4.Matrix4x4;
36
37
  * The cubic Cardinal spline characteristic matrix, parameterized by tension.
37
38
  *
38
39
  * Maps four control points to the monomial cubic coefficients of one
39
- * Cardinal segment. The tension `s` controls how tightly the curve hugs
40
- * the control points: `s = 0` produces straight-line segments between
41
- * adjacent points, `s = 0.5` is the Catmull-Rom variant (see
42
- * {@link cubicCatmullRom}), and higher values produce looser, more curved
43
- * shapes.
40
+ * Cardinal segment. The tension controls how tightly the curve hugs the
41
+ * control points. `0` produces straight-line segments between adjacent
42
+ * points, `0.5` is the Catmull-Rom variant (`cubicCatmullRom`), and
43
+ * higher values produce looser, more curved shapes.
44
44
  *
45
- * Cached per tension value — repeated calls with the same tension return
45
+ * Cached per tension value, so repeated calls with the same tension return
46
46
  * the same matrix instance.
47
47
  *
48
- * @param tension - The tension parameter.
48
+ * @param tension - How tightly the curve hugs the control points. `0` gives straight segments, `0.5` Catmull-Rom.
49
49
  * @returns The characteristic matrix for that tension.
50
50
  * @since 2.0.0
51
51
  */
52
52
  export declare const cubicCardinal: (tension: number) => Matrix4x4.Matrix4x4;
53
53
  /**
54
- * The cubic Catmull-Rom characteristic matrix — Cardinal with tension `0.5`.
55
- * The most common Cardinal-family variant; reused widely enough to deserve
56
- * a constant.
54
+ * The cubic Catmull-Rom characteristic matrix: Cardinal with tension
55
+ * `0.5`, the most common Cardinal-family variant.
57
56
  *
58
57
  * @since 2.0.0
59
58
  */
@@ -63,14 +62,14 @@ export declare const cubicCatmullRom: Matrix4x4.Matrix4x4;
63
62
  * N cubic polynomials in monomial form.
64
63
  *
65
64
  * Each channel is a `Vector4` packing one axis's values across the four
66
- * control points: `(v₀, v₁, v₂, v₃)`. The result tuple has the same arity
65
+ * control points: `(v0, v1, v2, v3)`. The result tuple has the same arity
67
66
  * as the input.
68
67
  *
69
- * The polynomial 2D spline pipeline applies this with two channels (x, y);
70
- * the rational 2D pipeline uses three (x, y, w) where `w` is the projective
68
+ * The polynomial 2D spline pipeline applies this with two channels (x, y).
69
+ * The rational 2D pipeline uses three (x, y, w) where `w` is the projective
71
70
  * denominator. Higher channel counts generalize to 3D, rational 3D, and
72
- * beyond — the characteristic matrix doesn't care about the geometric
73
- * domain, only about how to combine four samples per channel.
71
+ * beyond, since the characteristic matrix reads nothing about the geometric
72
+ * domain, only how to combine four samples per channel.
74
73
  *
75
74
  * @param matrix - The characteristic matrix of the spline family.
76
75
  * @param channels - One `Vector4` per output polynomial, packing the four control values for that channel.
@@ -1,2 +1,2 @@
1
- import { n as characteristic_exports } from "../shared/characteristic--7nC4Q_a.mjs";
1
+ import { n as characteristic_exports } from "../shared/characteristic-DQNPi4wd.mjs";
2
2
  export { characteristic_exports as Characteristic };
@@ -8,12 +8,11 @@ import type * as Solution from '../solution/solution.ts';
8
8
  import type { Affine2d } from '../transform/affine2d.ts';
9
9
  import type { Vector2 } from '../vector/vector2.ts';
10
10
  import type { CubicCurve2dTypeId } from './cubic2d.internal.ts';
11
- import type { Curve2dOps } from './curve2d.ts';
12
11
  export type { Monotonic, Increasing, Decreasing } from '../polynomial/traits.ts';
13
12
  /**
14
13
  * A cubic curve in 2D space.
15
14
  *
16
- * All fields are readonly and immutable, and all operations create new instances.
15
+ * All fields are readonly. No operation mutates a curve.
17
16
  *
18
17
  * The two type parameters carry the trait sets of the curve's per-axis
19
18
  * polynomials. Refiners check monotonicity over the unit interval `[0, 1]` —
@@ -36,14 +35,14 @@ export declare const fromPolynomials: (x: CubicPolynomial, y: CubicPolynomial) =
36
35
  /**
37
36
  * Creates a new `CubicCurve2d` instance from monomial coefficient vectors.
38
37
  *
39
- * Each argument bundles the per-axis coefficient at the given power: `c0`
40
- * holds the x⁰ term, `c1` holds the x¹ term, and so on. The resulting curve
41
- * evaluates to `c0 + c1·t + c2·t² + c3·t³` per axis.
38
+ * Each argument bundles the per-axis coefficient at the given power. `c0`
39
+ * holds the x^0 term, `c1` holds the x^1 term, and so on. The resulting curve
40
+ * evaluates to `c0 + c1*t + c2*t^2 + c3*t^3` per axis.
42
41
  *
43
- * @param c0 - The x⁰ coefficients (x and y).
44
- * @param c1 - The x¹ coefficients (x and y).
45
- * @param c2 - The x² coefficients (x and y).
46
- * @param c3 - The x³ coefficients (x and y).
42
+ * @param c0 - The x^0 coefficients (x and y).
43
+ * @param c1 - The x^1 coefficients (x and y).
44
+ * @param c2 - The x^2 coefficients (x and y).
45
+ * @param c3 - The x^3 coefficients (x and y).
47
46
  * @returns A new `CubicCurve2d` instance.
48
47
  * @since 2.0.0
49
48
  */
@@ -51,7 +50,7 @@ export declare const fromCoefficients: (c0: Vector2, c1: Vector2, c2: Vector2, c
51
50
  /**
52
51
  * Creates a new `CubicCurve2d` instance from cubic Bézier control points.
53
52
  *
54
- * The four arguments are the Bernstein-basis control points: `p0` and `p3` are
53
+ * The four arguments are the Bernstein-basis control points. `p0` and `p3` are
55
54
  * the curve's endpoints and `p1` and `p2` are the off-curve control handles.
56
55
  * The implementation converts to the curve's internal monomial form in closed
57
56
  * form.
@@ -74,38 +73,43 @@ export declare const fromBezierPoints: (p0: Vector2, p1: Vector2, p2: Vector2, p
74
73
  export declare const isCubicCurve2d: (c: unknown) => c is CubicCurve2d;
75
74
  export declare const solve: {
76
75
  /**
77
- * Solves the cubic curve for a given parameter t.
76
+ * Evaluates the curve at parameter `t`.
78
77
  *
79
- * @param t - The parameter value.
80
- * @returns A function that takes a cubic curve and returns the point on the curve at parameter t.
78
+ * @param t - The curve parameter, conventionally in `[0, 1]`.
79
+ * @returns A function that takes a cubic curve and returns the point at `t`.
81
80
  * @since 1.0.0
82
81
  */
83
82
  (t: number): (c: CubicCurve2d) => Vector2;
84
83
  /**
85
- * Solves the cubic curve for a given parameter t.
84
+ * Evaluates the curve at parameter `t`.
86
85
  *
87
- * @param c - The cubic curve to solve.
88
- * @param t - The parameter value.
89
- * @returns The point on the curve at parameter t.
86
+ * `t` is not clamped. Values outside `[0, 1]` extrapolate the curve's
87
+ * polynomials.
88
+ *
89
+ * @param c - The cubic curve to evaluate.
90
+ * @param t - The curve parameter, conventionally in `[0, 1]`.
91
+ * @returns The point on the curve at parameter `t`.
90
92
  * @since 1.0.0
91
93
  */
92
94
  (c: CubicCurve2d, t: number): Vector2;
93
95
  };
94
96
  export declare const length: {
95
97
  /**
96
- * Calculates (approximates) the length of a cubic curve.
98
+ * Calculates the arc length of a cubic curve over an interval of its
99
+ * parameter domain, approximated by numerical quadrature.
97
100
  *
98
- * @param c - The cubic curve to calculate the length of.
99
- * @param i - The interval over which to calculate the length.
100
- * @returns The length of the cubic curve.
101
+ * @param c - The cubic curve to measure.
102
+ * @param i - The parameter interval to measure over.
103
+ * @returns The arc length over the interval, to quadrature accuracy.
101
104
  * @since 1.0.0
102
105
  */
103
106
  (c: CubicCurve2d, i: Interval): number;
104
107
  /**
105
- * Calculates (approximates) the length of a cubic curve.
108
+ * Calculates the arc length of a cubic curve over an interval of its
109
+ * parameter domain, approximated by numerical quadrature.
106
110
  *
107
- * @param i - The interval over which to calculate the length.
108
- * @returns A function that takes a cubic curve and returns the length of the cubic curve.
111
+ * @param i - The parameter interval to measure over.
112
+ * @returns A function that takes a cubic curve and returns the arc length.
109
113
  * @since 1.0.0
110
114
  */
111
115
  (i: Interval): (c: CubicCurve2d) => number;
@@ -113,7 +117,7 @@ export declare const length: {
113
117
  export declare const solveAtX: {
114
118
  /**
115
119
  * Evaluates the curve's y values at a given x. Because the x polynomial is
116
- * `Monotonic`, the inverse has at most one solution — at most one y value.
120
+ * `Monotonic`, the inverse has at most one solution, at most one y value.
117
121
  *
118
122
  * @param c - The cubic curve.
119
123
  * @param x - The x coordinate.
@@ -123,7 +127,7 @@ export declare const solveAtX: {
123
127
  <XT extends Monotonic, YT>(c: CubicCurve2d<XT, YT>, x: number): Solution.AtMostOne<number>;
124
128
  /**
125
129
  * Evaluates the curve's y values at a given x. The result is the y values
126
- * the curve passes through where x(t) = the given x — up to three solutions
130
+ * the curve passes through where x(t) = the given x, up to three solutions
127
131
  * for a cubic curve.
128
132
  *
129
133
  * @param c - The cubic curve.
@@ -132,7 +136,13 @@ export declare const solveAtX: {
132
136
  * @since 2.0.0
133
137
  */
134
138
  <XT, YT>(c: CubicCurve2d<XT, YT>, x: number): Solution.AtMostThree<number>;
135
- /** @since 2.0.0 */
139
+ /**
140
+ * Evaluates the curve's y values at a given x.
141
+ *
142
+ * @param x - The x coordinate.
143
+ * @returns A function that takes a cubic curve and returns the y values at `x`.
144
+ * @since 2.0.0
145
+ */
136
146
  (x: number): {
137
147
  <XT extends Monotonic, YT>(c: CubicCurve2d<XT, YT>): Solution.AtMostOne<number>;
138
148
  <XT, YT>(c: CubicCurve2d<XT, YT>): Solution.AtMostThree<number>;
@@ -151,7 +161,7 @@ export declare const solveAtY: {
151
161
  <XT, YT extends Monotonic>(c: CubicCurve2d<XT, YT>, y: number): Solution.AtMostOne<number>;
152
162
  /**
153
163
  * Evaluates the curve's x values at a given y. The result is the x values
154
- * the curve passes through where y(t) = the given y — up to three solutions
164
+ * the curve passes through where y(t) = the given y, up to three solutions
155
165
  * for a cubic curve.
156
166
  *
157
167
  * @param c - The cubic curve.
@@ -160,7 +170,13 @@ export declare const solveAtY: {
160
170
  * @since 2.0.0
161
171
  */
162
172
  <XT, YT>(c: CubicCurve2d<XT, YT>, y: number): Solution.AtMostThree<number>;
163
- /** @since 2.0.0 */
173
+ /**
174
+ * Evaluates the curve's x values at a given y.
175
+ *
176
+ * @param y - The y coordinate.
177
+ * @returns A function that takes a cubic curve and returns the x values at `y`.
178
+ * @since 2.0.0
179
+ */
164
180
  (y: number): {
165
181
  <XT, YT extends Monotonic>(c: CubicCurve2d<XT, YT>): Solution.AtMostOne<number>;
166
182
  <XT, YT>(c: CubicCurve2d<XT, YT>): Solution.AtMostThree<number>;
@@ -191,12 +207,12 @@ export declare const curvature: {
191
207
  * box is tight against the curve and not just the control polygon.
192
208
  *
193
209
  * @param c - The cubic curve.
194
- * @returns A closed `Box2d` enclosing the curve.
210
+ * @returns A closed `Interval2d` enclosing the curve.
195
211
  * @since 2.0.0
196
212
  */
197
213
  export declare const boundingBox: (c: CubicCurve2d) => Interval2d<Closed, Closed>;
198
214
  /**
199
- * Evaluates the curve at `t = 0` in closed form — `(c.x.c0, c.y.c0)`.
215
+ * Evaluates the curve at `t = 0` in closed form: `(c.x.c0, c.y.c0)`.
200
216
  *
201
217
  * @param c - The cubic curve.
202
218
  * @returns The point at the start of the curve's parameter domain.
@@ -204,7 +220,7 @@ export declare const boundingBox: (c: CubicCurve2d) => Interval2d<Closed, Closed
204
220
  */
205
221
  export declare const startPoint: (c: CubicCurve2d) => Vector2;
206
222
  /**
207
- * Evaluates the curve at `t = 1` in closed form — the sum of the per-axis
223
+ * Evaluates the curve at `t = 1` in closed form, the sum of the per-axis
208
224
  * monomial coefficients.
209
225
  *
210
226
  * @param c - The cubic curve.
@@ -231,7 +247,7 @@ export declare const xRange: (c: CubicCurve2d) => Closed;
231
247
  */
232
248
  export declare const yRange: (c: CubicCurve2d) => Closed;
233
249
  /**
234
- * Renders the curve as a single SVG path-data drawing command — for a cubic
250
+ * Renders the curve as a single SVG path-data drawing command. For a cubic
235
251
  * curve, `C ctrl1X,ctrl1Y ctrl2X,ctrl2Y endX,endY`. Bernstein control points
236
252
  * are recovered from the monomial coefficients in closed form. Does not
237
253
  * include a leading `M`.
@@ -242,50 +258,127 @@ export declare const yRange: (c: CubicCurve2d) => Closed;
242
258
  */
243
259
  export declare const toPathDataSegment: (c: CubicCurve2d) => string;
244
260
  /**
245
- * Type-narrowing predicate: refines the curve's x-axis trait to include
246
- * `Monotonic` when the x polynomial is strictly monotonic on the unit
247
- * interval `[0, 1]`. The y-axis trait is unchanged.
261
+ * Checks if the curve's x polynomial is strictly monotonic on the unit
262
+ * interval `[0, 1]`, adding `Monotonic` to the x-axis trait. The y-axis
263
+ * trait is unchanged.
248
264
  *
265
+ * @param c - The cubic curve to check.
266
+ * @returns `true` when x is strictly monotonic on `[0, 1]`, narrowing the x-axis trait.
249
267
  * @since 2.0.0
250
268
  */
251
269
  export declare const isMonotonicX: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Monotonic, YT>;
252
- /** @since 2.0.0 */
270
+ /**
271
+ * Checks if the curve's x polynomial is strictly increasing on the
272
+ * unit interval `[0, 1]`, adding `Increasing` to the x-axis trait.
273
+ * The y-axis trait is unchanged.
274
+ *
275
+ * @param c - The cubic curve to check.
276
+ * @returns `true` when x is strictly increasing on `[0, 1]`, narrowing the x-axis trait.
277
+ * @since 2.0.0
278
+ */
253
279
  export declare const isIncreasingX: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Increasing, YT>;
254
- /** @since 2.0.0 */
280
+ /**
281
+ * Checks if the curve's x polynomial is strictly decreasing on the
282
+ * unit interval `[0, 1]`, adding `Decreasing` to the x-axis trait.
283
+ * The y-axis trait is unchanged.
284
+ *
285
+ * @param c - The cubic curve to check.
286
+ * @returns `true` when x is strictly decreasing on `[0, 1]`, narrowing the x-axis trait.
287
+ * @since 2.0.0
288
+ */
255
289
  export declare const isDecreasingX: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Decreasing, YT>;
256
290
  /**
257
- * Type-narrowing predicate: refines the curve's y-axis trait to include
258
- * `Monotonic`. The x-axis trait is unchanged.
291
+ * Checks if the curve's y polynomial is strictly monotonic on the unit
292
+ * interval `[0, 1]`, adding `Monotonic` to the y-axis trait. The x-axis
293
+ * trait is unchanged.
259
294
  *
295
+ * @param c - The cubic curve to check.
296
+ * @returns `true` when y is strictly monotonic on `[0, 1]`, narrowing the y-axis trait.
260
297
  * @since 2.0.0
261
298
  */
262
299
  export declare const isMonotonicY: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT, YT & Monotonic>;
263
- /** @since 2.0.0 */
300
+ /**
301
+ * Checks if the curve's y polynomial is strictly increasing on the
302
+ * unit interval `[0, 1]`, adding `Increasing` to the y-axis trait.
303
+ * The x-axis trait is unchanged.
304
+ *
305
+ * @param c - The cubic curve to check.
306
+ * @returns `true` when y is strictly increasing on `[0, 1]`, narrowing the y-axis trait.
307
+ * @since 2.0.0
308
+ */
264
309
  export declare const isIncreasingY: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT, YT & Increasing>;
265
- /** @since 2.0.0 */
310
+ /**
311
+ * Checks if the curve's y polynomial is strictly decreasing on the
312
+ * unit interval `[0, 1]`, adding `Decreasing` to the y-axis trait.
313
+ * The x-axis trait is unchanged.
314
+ *
315
+ * @param c - The cubic curve to check.
316
+ * @returns `true` when y is strictly decreasing on `[0, 1]`, narrowing the y-axis trait.
317
+ * @since 2.0.0
318
+ */
266
319
  export declare const isDecreasingY: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT, YT & Decreasing>;
267
320
  /**
268
- * Type-narrowing predicate: refines both axes' traits to include `Monotonic`
269
- * when both x and y polynomials are monotonic over the unit interval `[0, 1]`.
321
+ * Checks if both the x and y polynomials are strictly monotonic on the
322
+ * unit interval `[0, 1]`, adding `Monotonic` to both axes' traits.
270
323
  *
324
+ * @param c - The cubic curve to check.
325
+ * @returns `true` when both axes are strictly monotonic on `[0, 1]`, narrowing both traits.
271
326
  * @since 2.0.0
272
327
  */
273
328
  export declare const isMonotonic: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Monotonic, YT & Monotonic>;
274
- /** @since 2.0.0 */
329
+ /**
330
+ * Checks if both the x and y polynomials are strictly increasing on
331
+ * the unit interval `[0, 1]`, adding `Increasing` to both axes' traits.
332
+ *
333
+ * @param c - The cubic curve to check.
334
+ * @returns `true` when both axes are strictly increasing on `[0, 1]`, narrowing both traits.
335
+ * @since 2.0.0
336
+ */
275
337
  export declare const isIncreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Increasing, YT & Increasing>;
276
- /** @since 2.0.0 */
338
+ /**
339
+ * Checks if both the x and y polynomials are strictly decreasing on
340
+ * the unit interval `[0, 1]`, adding `Decreasing` to both axes' traits.
341
+ *
342
+ * @param c - The cubic curve to check.
343
+ * @returns `true` when both axes are strictly decreasing on `[0, 1]`, narrowing both traits.
344
+ * @since 2.0.0
345
+ */
277
346
  export declare const isDecreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Decreasing, YT & Decreasing>;
278
- /** @since 2.0.0 */
347
+ /**
348
+ * Asserts that both axes are strictly monotonic on the unit interval
349
+ * `[0, 1]`, throwing on failure.
350
+ *
351
+ * @param c - The cubic curve to assert against.
352
+ * @returns The same curve, with `Monotonic` on both axes' traits.
353
+ * @throws `Error` when either axis fails the check.
354
+ * @since 2.0.0
355
+ */
279
356
  export declare const asMonotonic: <XT, YT>(c: CubicCurve2d<XT, YT>) => CubicCurve2d<XT & Monotonic, YT & Monotonic>;
280
- /** @since 2.0.0 */
357
+ /**
358
+ * Asserts that both axes are strictly increasing on the unit interval
359
+ * `[0, 1]`, throwing on failure.
360
+ *
361
+ * @param c - The cubic curve to assert against.
362
+ * @returns The same curve, with `Increasing` on both axes' traits.
363
+ * @throws `Error` when either axis fails the check.
364
+ * @since 2.0.0
365
+ */
281
366
  export declare const asIncreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => CubicCurve2d<XT & Increasing, YT & Increasing>;
282
- /** @since 2.0.0 */
367
+ /**
368
+ * Asserts that both axes are strictly decreasing on the unit interval
369
+ * `[0, 1]`, throwing on failure.
370
+ *
371
+ * @param c - The cubic curve to assert against.
372
+ * @returns The same curve, with `Decreasing` on both axes' traits.
373
+ * @throws `Error` when either axis fails the check.
374
+ * @since 2.0.0
375
+ */
283
376
  export declare const asDecreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => CubicCurve2d<XT & Decreasing, YT & Decreasing>;
284
377
  export declare const transform: {
285
378
  /**
286
379
  * Applies an `Affine2d` transform to a `CubicCurve2d`, returning a new
287
380
  * curve whose image is the affine image of the original. Internally the
288
- * transformation works directly on monomial coefficients — `c0` receives
381
+ * transformation works directly on monomial coefficients. `c0` receives
289
382
  * the full affine, `c1`/`c2`/`c3` receive only the linear part.
290
383
  *
291
384
  * @param c - The cubic curve.
@@ -303,12 +396,3 @@ export declare const transform: {
303
396
  */
304
397
  (a: Affine2d): (c: CubicCurve2d) => CubicCurve2d;
305
398
  };
306
- /**
307
- * The {@link Curve2dOps} bundle for `CubicCurve2d`. Used by `CubicPath2d`
308
- * to wire up the path-level operation surface. The `solveAtX` / `solveAtY`
309
- * entries narrow the curve's potentially-3-element result to `AtMostOne` —
310
- * path callers enforce that via the path's `MonotonicX`/`MonotonicY` brand.
311
- *
312
- * @since 2.0.0
313
- */
314
- export declare const Ops: Curve2dOps<CubicCurve2d>;
@@ -10,14 +10,14 @@ import type { Vector2 } from '../vector/vector2.ts';
10
10
  * instance which the corresponding path module passes to
11
11
  * `Path2d.make(ops)` to derive its operation surface.
12
12
  *
13
- * The interface is intentionally small — anything that isn't shared
14
- * structurally across curve degrees stays on the per-degree module.
13
+ * The interface stays small. Anything that isn't shared structurally
14
+ * across curve degrees stays on the per-degree module.
15
15
  *
16
16
  * @since 2.0.0
17
17
  */
18
18
  export interface Curve2dOps<C> {
19
19
  /**
20
- * Evaluate the curve at parameter `t ∈ [0, 1]`.
20
+ * Evaluate the curve at parameter `t in [0, 1]`.
21
21
  */
22
22
  solve(c: C, t: number): Vector2;
23
23
  /**
@@ -42,11 +42,11 @@ export interface Curve2dOps<C> {
42
42
  */
43
43
  solveAtX(c: C, x: number): Solution.AtMostOne<number>;
44
44
  /**
45
- * y-axis analog of {@link solveAtX}.
45
+ * y-axis analog of `solveAtX`.
46
46
  */
47
47
  solveAtY(c: C, y: number): Solution.AtMostOne<number>;
48
48
  /**
49
- * SVG path-data drawing command for one segment (`L …`, `Q …`, `C …`),
49
+ * SVG path-data drawing command for one segment (`L ...`, `Q ...`, `C ...`),
50
50
  * without a leading `M`. Move-insertion is decided by the path-level
51
51
  * `toPathData` based on continuity with the previous segment.
52
52
  */
@@ -71,7 +71,7 @@ export interface Curve2dOps<C> {
71
71
  * Apply an affine transform to the curve, returning a new curve whose
72
72
  * geometric image is the affine image of the original.
73
73
  *
74
- * For non-rational coefficient-form curves this is per-coefficient: the
74
+ * For non-rational coefficient-form curves this is per-coefficient. The
75
75
  * constant coefficient receives the full affine, and all higher-degree
76
76
  * coefficients receive only the linear part. For rational curves the
77
77
  * translation is folded into the numerator polynomials weighted by the
@@ -1,2 +1,2 @@
1
- import { c as cubic2d_exports, h as quadratic2d_exports, i as rationalCubic2d_exports, y as linear2d_exports } from "../shared/rationalCubic2d-CZSwwKtS.mjs";
1
+ import { i as rationalCubic2d_exports, m as quadratic2d_exports, s as cubic2d_exports, v as linear2d_exports } from "../shared/rationalCubic2d-D_TBd-3i.mjs";
2
2
  export { cubic2d_exports as CubicCurve2d, linear2d_exports as LinearCurve2d, quadratic2d_exports as QuadraticCurve2d, rationalCubic2d_exports as RationalCubicCurve2d };