curvy 1.0.9 → 2.0.0-alpha.2

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 (173) hide show
  1. package/dist/characteristic/index.d.mts +88 -0
  2. package/dist/characteristic/index.mjs +2 -0
  3. package/dist/curve/index.d.mts +2 -0
  4. package/dist/curve/index.mjs +2 -0
  5. package/dist/interval/index.d.mts +3 -0
  6. package/dist/interval/index.mjs +3 -0
  7. package/dist/matrix/index.d.mts +2 -0
  8. package/dist/matrix/index.mjs +267 -0
  9. package/dist/matrix/index.mjs.map +1 -0
  10. package/dist/number.d.mts +280 -0
  11. package/dist/number.mjs +140 -0
  12. package/dist/number.mjs.map +1 -0
  13. package/dist/path/index.d.mts +261 -0
  14. package/dist/path/index.mjs +325 -0
  15. package/dist/path/index.mjs.map +1 -0
  16. package/dist/polynomial/index.d.mts +2 -0
  17. package/dist/polynomial/index.mjs +3 -0
  18. package/dist/shared/characteristic-B9nCh_cx.mjs +104 -0
  19. package/dist/shared/characteristic-B9nCh_cx.mjs.map +1 -0
  20. package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
  21. package/dist/shared/cubic-BajUY0JT.d.mts +1100 -0
  22. package/dist/shared/cubic-CpHAx8cC.mjs +479 -0
  23. package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
  24. package/dist/shared/interval-05CR6eBf.mjs +421 -0
  25. package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
  26. package/dist/shared/interval-Dy-RMEE3.d.mts +533 -0
  27. package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
  28. package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
  29. package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
  30. package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
  31. package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
  32. package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +1183 -0
  33. package/dist/shared/quadratic-CamozcFc.mjs +330 -0
  34. package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
  35. package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +308 -0
  36. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs +295 -0
  37. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
  38. package/dist/shared/rationalCubic2d-Bys2Uory.mjs +695 -0
  39. package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
  40. package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +818 -0
  41. package/dist/shared/solution-CrtLfqEq.mjs +306 -0
  42. package/dist/shared/solution-CrtLfqEq.mjs.map +1 -0
  43. package/dist/shared/solution-sNQ-ZVhN.d.mts +251 -0
  44. package/dist/{pipe.d.mts → shared/utils-MCckigYk.d.mts} +44 -26
  45. package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
  46. package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
  47. package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
  48. package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
  49. package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
  50. package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
  51. package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
  52. package/dist/shared/vector3-DqeOZtOB.d.mts +703 -0
  53. package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
  54. package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
  55. package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
  56. package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
  57. package/dist/solution/index.d.mts +2 -0
  58. package/dist/solution/index.mjs +2 -0
  59. package/dist/splines/index.d.mts +701 -0
  60. package/dist/splines/index.mjs +734 -0
  61. package/dist/splines/index.mjs.map +1 -0
  62. package/dist/utils.d.mts +2 -205
  63. package/dist/utils.mjs +88 -52
  64. package/dist/utils.mjs.map +1 -1
  65. package/dist/vector/index.d.mts +3 -0
  66. package/dist/vector/index.mjs +4 -0
  67. package/package.json +49 -92
  68. package/dist/curve/cubic2d.d.mts +0 -109
  69. package/dist/curve/cubic2d.d.ts +0 -109
  70. package/dist/curve/cubic2d.mjs +0 -80
  71. package/dist/curve/cubic2d.mjs.map +0 -1
  72. package/dist/curve/linear2d.d.mts +0 -94
  73. package/dist/curve/linear2d.d.ts +0 -94
  74. package/dist/curve/linear2d.mjs +0 -46
  75. package/dist/curve/linear2d.mjs.map +0 -1
  76. package/dist/curve/quadratic2d.d.mts +0 -117
  77. package/dist/curve/quadratic2d.d.ts +0 -117
  78. package/dist/curve/quadratic2d.mjs +0 -82
  79. package/dist/curve/quadratic2d.mjs.map +0 -1
  80. package/dist/interval.d.mts +0 -251
  81. package/dist/interval.d.ts +0 -251
  82. package/dist/interval.mjs +0 -86
  83. package/dist/interval.mjs.map +0 -1
  84. package/dist/matrix/matrix2x2.d.mts +0 -320
  85. package/dist/matrix/matrix2x2.d.ts +0 -320
  86. package/dist/matrix/matrix2x2.mjs +0 -25
  87. package/dist/matrix/matrix2x2.mjs.map +0 -1
  88. package/dist/matrix/matrix3x3.d.mts +0 -370
  89. package/dist/matrix/matrix3x3.d.ts +0 -370
  90. package/dist/matrix/matrix3x3.mjs +0 -28
  91. package/dist/matrix/matrix3x3.mjs.map +0 -1
  92. package/dist/matrix/matrix4x4.d.mts +0 -381
  93. package/dist/matrix/matrix4x4.d.ts +0 -381
  94. package/dist/matrix/matrix4x4.mjs +0 -178
  95. package/dist/matrix/matrix4x4.mjs.map +0 -1
  96. package/dist/path/cubic2d.d.mts +0 -95
  97. package/dist/path/cubic2d.d.ts +0 -95
  98. package/dist/path/cubic2d.mjs +0 -60
  99. package/dist/path/cubic2d.mjs.map +0 -1
  100. package/dist/path/linear2d.d.mts +0 -95
  101. package/dist/path/linear2d.d.ts +0 -95
  102. package/dist/path/linear2d.mjs +0 -53
  103. package/dist/path/linear2d.mjs.map +0 -1
  104. package/dist/path/quadratic2d.d.mts +0 -95
  105. package/dist/path/quadratic2d.d.ts +0 -95
  106. package/dist/path/quadratic2d.mjs +0 -57
  107. package/dist/path/quadratic2d.mjs.map +0 -1
  108. package/dist/pipe.d.ts +0 -58
  109. package/dist/pipe.mjs +0 -92
  110. package/dist/pipe.mjs.map +0 -1
  111. package/dist/polynomial/cubic.d.mts +0 -7
  112. package/dist/polynomial/cubic.d.ts +0 -7
  113. package/dist/polynomial/cubic.mjs +0 -133
  114. package/dist/polynomial/cubic.mjs.map +0 -1
  115. package/dist/polynomial/linear.d.mts +0 -7
  116. package/dist/polynomial/linear.d.ts +0 -7
  117. package/dist/polynomial/linear.mjs +0 -24
  118. package/dist/polynomial/linear.mjs.map +0 -1
  119. package/dist/polynomial/quadratic.d.mts +0 -7
  120. package/dist/polynomial/quadratic.d.ts +0 -7
  121. package/dist/polynomial/quadratic.mjs +0 -27
  122. package/dist/polynomial/quadratic.mjs.map +0 -1
  123. package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
  124. package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
  125. package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
  126. package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
  127. package/dist/shared/curvy.BxdGW9he.mjs +0 -116
  128. package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
  129. package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
  130. package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
  131. package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
  132. package/dist/shared/curvy.DCt1gGII.mjs +0 -147
  133. package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
  134. package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
  135. package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
  136. package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
  137. package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
  138. package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
  139. package/dist/shared/curvy.lktriTpx.mjs +0 -101
  140. package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
  141. package/dist/shared/curvy.mLFprrGm.mjs +0 -85
  142. package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
  143. package/dist/shared/curvy.r6f1j287.mjs +0 -76
  144. package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
  145. package/dist/splines/basis2d.d.mts +0 -130
  146. package/dist/splines/basis2d.d.ts +0 -130
  147. package/dist/splines/basis2d.mjs +0 -90
  148. package/dist/splines/basis2d.mjs.map +0 -1
  149. package/dist/splines/bezier2d.d.mts +0 -182
  150. package/dist/splines/bezier2d.d.ts +0 -182
  151. package/dist/splines/bezier2d.mjs +0 -23
  152. package/dist/splines/bezier2d.mjs.map +0 -1
  153. package/dist/splines/cardinal2d.d.mts +0 -178
  154. package/dist/splines/cardinal2d.d.ts +0 -178
  155. package/dist/splines/cardinal2d.mjs +0 -114
  156. package/dist/splines/cardinal2d.mjs.map +0 -1
  157. package/dist/splines/hermite2d.d.mts +0 -124
  158. package/dist/splines/hermite2d.d.ts +0 -124
  159. package/dist/splines/hermite2d.mjs +0 -63
  160. package/dist/splines/hermite2d.mjs.map +0 -1
  161. package/dist/utils.d.ts +0 -205
  162. package/dist/vector/vector2.d.mts +0 -324
  163. package/dist/vector/vector2.d.ts +0 -324
  164. package/dist/vector/vector2.mjs +0 -30
  165. package/dist/vector/vector2.mjs.map +0 -1
  166. package/dist/vector/vector3.d.mts +0 -417
  167. package/dist/vector/vector3.d.ts +0 -417
  168. package/dist/vector/vector3.mjs +0 -38
  169. package/dist/vector/vector3.mjs.map +0 -1
  170. package/dist/vector/vector4.d.mts +0 -205
  171. package/dist/vector/vector4.d.ts +0 -205
  172. package/dist/vector/vector4.mjs +0 -20
  173. package/dist/vector/vector4.mjs.map +0 -1
@@ -0,0 +1,818 @@
1
+ import { n as Weighted, t as Vector2, u as TwoDimensional } from "./vector2-DPUY3_eA.mjs";
2
+ import { t as Pipeable } from "./utils-MCckigYk.mjs";
3
+ import { n as Closed, r as Interval } from "./interval-Dy-RMEE3.mjs";
4
+ import { n as AtMostThree, r as AtMostTwo, t as AtMostOne } from "./solution-sNQ-ZVhN.mjs";
5
+ import { a as LinearPolynomial, c as Increasing, l as Monotonic, r as QuadraticPolynomial, s as Decreasing, t as CubicPolynomial } from "./cubic-BajUY0JT.mjs";
6
+ import { t as Interval2d } from "./interval2d-C2id9u31.mjs";
7
+
8
+ //#region src/curve/linear2d.internal.d.ts
9
+ declare const LinearCurve2dTypeId: unique symbol;
10
+ type LinearCurve2dTypeId = typeof LinearCurve2dTypeId;
11
+ declare namespace linear2d_d_exports {
12
+ export { Decreasing, Increasing, LinearCurve2d, Monotonic, asDecreasing$2 as asDecreasing, asIncreasing$2 as asIncreasing, asMonotonic$2 as asMonotonic, boundingBox$2 as boundingBox, derivative$1 as derivative, fromBezierPoints$3 as fromBezierPoints, fromCoefficients$2 as fromCoefficients, fromPolynomials$3 as fromPolynomials, isDecreasing$2 as isDecreasing, isIncreasing$2 as isIncreasing, isLinearCurve2d, isMonotonic$2 as isMonotonic, length$2 as length, solve$3 as solve, solveAtX$3 as solveAtX, solveAtY$3 as solveAtY };
13
+ }
14
+ /**
15
+ * A linear curve in 2D space.
16
+ *
17
+ * All fields are readonly and immutable, and all operations create new instances.
18
+ *
19
+ * The two type parameters carry the trait sets of the curve's per-axis
20
+ * polynomials. Refiners like `isMonotonic` lift each axis's monotonicity into
21
+ * the curve's combined trait set.
22
+ *
23
+ * @since 1.0.0
24
+ */
25
+ interface LinearCurve2d<out XTraits = unknown, out YTraits = unknown> extends Pipeable, TwoDimensional<LinearPolynomial<XTraits>, LinearPolynomial<YTraits>> {
26
+ readonly [LinearCurve2dTypeId]: LinearCurve2dTypeId;
27
+ }
28
+ /**
29
+ * Creates a new `LinearCurve2d` instance from polynomial parameters.
30
+ *
31
+ * @param x - The x polynomial.
32
+ * @param y - The y polynomial.
33
+ * @returns A new `LinearCurve2d` instance.
34
+ * @since 1.0.0
35
+ */
36
+ declare const fromPolynomials$3: (x: LinearPolynomial, y: LinearPolynomial) => LinearCurve2d;
37
+ /**
38
+ * Creates a new `LinearCurve2d` instance from monomial coefficient vectors.
39
+ *
40
+ * Each argument bundles the per-axis coefficient at the given power: `c0`
41
+ * holds the x⁰ term, `c1` holds the x¹ term. The resulting curve evaluates to
42
+ * `c0 + c1·t` per axis.
43
+ *
44
+ * @param c0 - The x⁰ coefficients (x and y).
45
+ * @param c1 - The x¹ coefficients (x and y).
46
+ * @returns A new `LinearCurve2d` instance.
47
+ * @since 2.0.0
48
+ */
49
+ declare const fromCoefficients$2: (c0: Vector2, c1: Vector2) => LinearCurve2d;
50
+ /**
51
+ * Creates a new `LinearCurve2d` instance from a pair of endpoints.
52
+ *
53
+ * `p0` is the curve at `t = 0`, `p1` is the curve at `t = 1`. The
54
+ * implementation converts to the curve's internal monomial form (slope-form
55
+ * polynomial in `t`) in closed form.
56
+ *
57
+ * @param p0 - The curve's start point.
58
+ * @param p1 - The curve's end point.
59
+ * @returns A new `LinearCurve2d` instance whose curve matches the line from `p0` to `p1`.
60
+ * @since 2.0.0
61
+ */
62
+ declare const fromBezierPoints$3: (p0: Vector2, p1: Vector2) => LinearCurve2d;
63
+ /**
64
+ * Checks if a value is a `LinearCurve2d`.
65
+ *
66
+ * @param c - The value to check.
67
+ * @returns `true` if the value is a `LinearCurve2d`, `false` otherwise.
68
+ * @since 1.0.0
69
+ */
70
+ declare const isLinearCurve2d: (c: unknown) => c is LinearCurve2d;
71
+ /**
72
+ * Gets the derivative of a linear curve as a vector
73
+ *
74
+ * @param c - The linear curve to get the derivative of.
75
+ * @returns The derivative of the linear curve as a vector.
76
+ * @since 1.0.0
77
+ */
78
+ declare const derivative$1: (c: LinearCurve2d) => Vector2;
79
+ declare const solve$3: {
80
+ /**
81
+ * Solves the linear curve for a given parameter t.
82
+ *
83
+ * @param t - The parameter value.
84
+ * @returns A function that takes a linear curve and returns the point on the curve at parameter t.
85
+ * @since 1.0.0
86
+ */
87
+ (t: number): (c: LinearCurve2d) => Vector2;
88
+ /**
89
+ * Solves the linear curve for a given parameter t.
90
+ *
91
+ * @param c - The linear curve to solve.
92
+ * @param t - The parameter value.
93
+ * @returns The point on the curve at parameter t.
94
+ * @since 1.0.0
95
+ */
96
+ (c: LinearCurve2d, t: number): Vector2;
97
+ };
98
+ declare const length$2: {
99
+ /**
100
+ * Calculates (approximates) the length of a linear curve.
101
+ *
102
+ * @param c - The linear curve to calculate the length of.
103
+ * @param i - The interval to calculate the length over.
104
+ * @returns The length of the linear curve over the given interval.
105
+ * @since 1.0.0
106
+ */
107
+ (c: LinearCurve2d, i: Interval): number;
108
+ /**
109
+ * Calculates (approximates) the length of a linear curve.
110
+ *
111
+ * @param i - The interval to calculate the length over.
112
+ * @returns A function that takes a linear curve and returns the length of the linear curve over the given interval.
113
+ * @since 1.0.0
114
+ */
115
+ (i: Interval): (c: LinearCurve2d) => number;
116
+ };
117
+ /**
118
+ * Computes the axis-aligned bounding box of the curve over its parameter
119
+ * domain `[0, 1]`. For a linear curve this is the closed box enclosing the
120
+ * two endpoints.
121
+ *
122
+ * @param c - The linear curve.
123
+ * @returns A closed `Box2d` enclosing the curve.
124
+ * @since 2.1.0
125
+ */
126
+ declare const boundingBox$2: (c: LinearCurve2d) => Interval2d<Closed, Closed>;
127
+ declare const solveAtX$3: {
128
+ /**
129
+ * Evaluates the curve's y value at a given x. A linear curve crosses any
130
+ * vertical line at most once (within the curve's parameter domain `[0, 1]`),
131
+ * so the result is at most one y. Returns the empty tuple when x is outside
132
+ * the curve's range or when the curve's x polynomial is constant.
133
+ *
134
+ * @param c - The linear curve.
135
+ * @param x - The x coordinate.
136
+ * @returns The y value at x, or empty when x is undefined for this curve.
137
+ * @since 2.0.0
138
+ */
139
+ <XT, YT>(c: LinearCurve2d<XT, YT>, x: number): AtMostOne<number>; /** @since 2.0.0 */
140
+ (x: number): <XT, YT>(c: LinearCurve2d<XT, YT>) => AtMostOne<number>;
141
+ };
142
+ declare const solveAtY$3: {
143
+ /**
144
+ * Evaluates the curve's x value at a given y. A linear curve crosses any
145
+ * horizontal line at most once (within the curve's parameter domain
146
+ * `[0, 1]`), so the result is at most one x.
147
+ *
148
+ * @param c - The linear curve.
149
+ * @param y - The y coordinate.
150
+ * @returns The x value at y, or empty when y is undefined for this curve.
151
+ * @since 2.0.0
152
+ */
153
+ <XT, YT>(c: LinearCurve2d<XT, YT>, y: number): AtMostOne<number>; /** @since 2.0.0 */
154
+ (y: number): <XT, YT>(c: LinearCurve2d<XT, YT>) => AtMostOne<number>;
155
+ };
156
+ /**
157
+ * Type-narrowing predicate: refines both axes' traits to include `Monotonic`
158
+ * when both the x and y polynomials are strictly monotonic. When both axes
159
+ * are monotonic, the curve is invertible in either direction.
160
+ *
161
+ * For checking only one axis, call the polynomial-level refiner directly:
162
+ * `LinearPolynomial.isMonotonic(curve.x)`.
163
+ *
164
+ * @since 2.0.0
165
+ */
166
+ declare const isMonotonic$2: <XT, YT>(c: LinearCurve2d<XT, YT>) => c is LinearCurve2d<XT & Monotonic, YT & Monotonic>;
167
+ /**
168
+ * Type-narrowing predicate: refines both axes' traits to include `Increasing`.
169
+ *
170
+ * @since 2.0.0
171
+ */
172
+ declare const isIncreasing$2: <XT, YT>(c: LinearCurve2d<XT, YT>) => c is LinearCurve2d<XT & Increasing, YT & Increasing>;
173
+ /**
174
+ * Type-narrowing predicate: refines both axes' traits to include `Decreasing`.
175
+ *
176
+ * @since 2.0.0
177
+ */
178
+ declare const isDecreasing$2: <XT, YT>(c: LinearCurve2d<XT, YT>) => c is LinearCurve2d<XT & Decreasing, YT & Decreasing>;
179
+ /**
180
+ * Asserts monotonicity in both axes, throwing on failure.
181
+ *
182
+ * @since 2.0.0
183
+ */
184
+ declare const asMonotonic$2: <XT, YT>(c: LinearCurve2d<XT, YT>) => LinearCurve2d<XT & Monotonic, YT & Monotonic>;
185
+ /**
186
+ * Asserts that both axes are strictly increasing, throwing on failure.
187
+ *
188
+ * @since 2.0.0
189
+ */
190
+ declare const asIncreasing$2: <XT, YT>(c: LinearCurve2d<XT, YT>) => LinearCurve2d<XT & Increasing, YT & Increasing>;
191
+ /**
192
+ * Asserts that both axes are strictly decreasing, throwing on failure.
193
+ *
194
+ * @since 2.0.0
195
+ */
196
+ declare const asDecreasing$2: <XT, YT>(c: LinearCurve2d<XT, YT>) => LinearCurve2d<XT & Decreasing, YT & Decreasing>;
197
+ //#endregion
198
+ //#region src/curve/quadratic2d.internal.d.ts
199
+ declare const QuadraticCurve2dTypeId: unique symbol;
200
+ type QuadraticCurve2dTypeId = typeof QuadraticCurve2dTypeId;
201
+ declare namespace quadratic2d_d_exports {
202
+ export { Decreasing, Increasing, Monotonic, QuadraticCurve2d, asDecreasing$1 as asDecreasing, asIncreasing$1 as asIncreasing, asMonotonic$1 as asMonotonic, boundingBox$1 as boundingBox, curvature$1 as curvature, derivative, fromBezierPoints$2 as fromBezierPoints, fromCoefficients$1 as fromCoefficients, fromPolynomials$2 as fromPolynomials, isDecreasing$1 as isDecreasing, isIncreasing$1 as isIncreasing, isMonotonic$1 as isMonotonic, isQuadraticCurve2d, length$1 as length, solve$2 as solve, solveAtX$2 as solveAtX, solveAtY$2 as solveAtY };
203
+ }
204
+ /**
205
+ * A quadratic curve in 2D space.
206
+ *
207
+ * All fields are readonly and immutable, and all operations create new instances.
208
+ *
209
+ * The two type parameters carry the trait sets of the curve's per-axis
210
+ * polynomials. Refiners check monotonicity over the unit interval `[0, 1]` —
211
+ * the curve's natural parameter domain.
212
+ *
213
+ * @since 1.0.0
214
+ */
215
+ interface QuadraticCurve2d<out XTraits = unknown, out YTraits = unknown> extends Pipeable, TwoDimensional<QuadraticPolynomial<XTraits>, QuadraticPolynomial<YTraits>> {
216
+ readonly [QuadraticCurve2dTypeId]: QuadraticCurve2dTypeId;
217
+ }
218
+ /**
219
+ * Creates a new `QuadraticCurve2d` instance from polynomial parameters.
220
+ *
221
+ * @param c0 - The x polynomial.
222
+ * @param c1 - The y polynomial.
223
+ * @returns A new `QuadraticCurve2d` instance.
224
+ * @since 1.0.0
225
+ */
226
+ declare const fromPolynomials$2: (c0: QuadraticPolynomial, c1: QuadraticPolynomial) => QuadraticCurve2d;
227
+ /**
228
+ * Creates a new `QuadraticCurve2d` instance from monomial coefficient vectors.
229
+ *
230
+ * Each argument bundles the per-axis coefficient at the given power: `c0`
231
+ * holds the x⁰ term, `c1` holds the x¹ term, and so on. The resulting curve
232
+ * evaluates to `c0 + c1·t + c2·t²` per axis.
233
+ *
234
+ * @param c0 - The x⁰ coefficients (x and y).
235
+ * @param c1 - The x¹ coefficients (x and y).
236
+ * @param c2 - The x² coefficients (x and y).
237
+ * @returns A new `QuadraticCurve2d` instance.
238
+ * @since 2.0.0
239
+ */
240
+ declare const fromCoefficients$1: (c0: Vector2, c1: Vector2, c2: Vector2) => QuadraticCurve2d;
241
+ /**
242
+ * Creates a new `QuadraticCurve2d` instance from quadratic Bézier control
243
+ * points.
244
+ *
245
+ * The three arguments are the Bernstein-basis control points: `p0` and `p2`
246
+ * are the curve's endpoints and `p1` is the off-curve control handle. The
247
+ * implementation converts to the curve's internal monomial form in closed
248
+ * form.
249
+ *
250
+ * @param p0 - The first control point (curve start).
251
+ * @param p1 - The second control point (control handle).
252
+ * @param p2 - The third control point (curve end).
253
+ * @returns A new `QuadraticCurve2d` instance whose curve matches the given Bézier.
254
+ * @since 2.0.0
255
+ */
256
+ declare const fromBezierPoints$2: (p0: Vector2, p1: Vector2, p2: Vector2) => QuadraticCurve2d;
257
+ /**
258
+ * Checks if a value is a `QuadraticCurve2d`.
259
+ *
260
+ * @param c - The value to check.
261
+ * @returns `true` if the value is a `QuadraticCurve2d`, `false` otherwise.
262
+ * @since 1.0.0
263
+ */
264
+ declare const isQuadraticCurve2d: (c: unknown) => c is QuadraticCurve2d;
265
+ declare const solve$2: {
266
+ /**
267
+ * Solves the quadratic curve for a given parameter t.
268
+ *
269
+ * @param t - The parameter value.
270
+ * @returns A function that takes a quadratic curve and returns the point on the curve at parameter t.
271
+ * @since 1.0.0
272
+ */
273
+ (t: number): (c: QuadraticCurve2d) => Vector2;
274
+ /**
275
+ * Solves the quadratic curve for a given parameter t.
276
+ *
277
+ * @param c - The quadratic curve to solve.
278
+ * @param t - The parameter value.
279
+ * @returns The point on the curve at parameter t.
280
+ * @since 1.0.0
281
+ */
282
+ (c: QuadraticCurve2d, t: number): Vector2;
283
+ };
284
+ declare const length$1: {
285
+ /**
286
+ * Computes the length of the quadratic curve over a given interval.
287
+ *
288
+ * @param c - The quadratic curve to compute the length of.
289
+ * @param i - The interval over which to compute the length.
290
+ * @returns The length of the quadratic curve over the interval.
291
+ * @since 1.0.0
292
+ */
293
+ (c: QuadraticCurve2d, i: Interval): number;
294
+ /**
295
+ * Computes the length of the quadratic curve over a given interval.
296
+ *
297
+ * @param i - The interval over which to compute the length.
298
+ * @returns A function that takes a quadratic curve and returns the length of the curve over the interval.
299
+ * @since 1.0.0
300
+ */
301
+ (i: Interval): (c: QuadraticCurve2d) => number;
302
+ };
303
+ declare const solveAtX$2: {
304
+ /**
305
+ * Evaluates the curve's y values at a given x. Because the x polynomial is
306
+ * `Monotonic`, the inverse has at most one solution — at most one y value.
307
+ *
308
+ * @param c - The quadratic curve.
309
+ * @param x - The x coordinate.
310
+ * @returns Zero or one y values, in t-ascending order.
311
+ * @since 2.0.0
312
+ */
313
+ <XT extends Monotonic, YT>(c: QuadraticCurve2d<XT, YT>, x: number): AtMostOne<number>;
314
+ /**
315
+ * Evaluates the curve's y values at a given x. The result is the y values
316
+ * the curve passes through where x(t) = the given x — up to two solutions
317
+ * for a quadratic curve.
318
+ *
319
+ * @param c - The quadratic curve.
320
+ * @param x - The x coordinate.
321
+ * @returns The y values at x, in t-ascending order.
322
+ * @since 2.0.0
323
+ */
324
+ <XT, YT>(c: QuadraticCurve2d<XT, YT>, x: number): AtMostTwo<number>; /** @since 2.0.0 */
325
+ (x: number): {
326
+ <XT extends Monotonic, YT>(c: QuadraticCurve2d<XT, YT>): AtMostOne<number>;
327
+ <XT, YT>(c: QuadraticCurve2d<XT, YT>): AtMostTwo<number>;
328
+ };
329
+ };
330
+ declare const solveAtY$2: {
331
+ /**
332
+ * Evaluates the curve's x values at a given y. Because the y polynomial is
333
+ * `Monotonic`, the inverse has at most one solution.
334
+ *
335
+ * @param c - The quadratic curve.
336
+ * @param y - The y coordinate.
337
+ * @returns Zero or one x values, in t-ascending order.
338
+ * @since 2.0.0
339
+ */
340
+ <XT, YT extends Monotonic>(c: QuadraticCurve2d<XT, YT>, y: number): AtMostOne<number>;
341
+ /**
342
+ * Evaluates the curve's x values at a given y. The result is the x values
343
+ * the curve passes through where y(t) = the given y — up to two solutions
344
+ * for a quadratic curve.
345
+ *
346
+ * @param c - The quadratic curve.
347
+ * @param y - The y coordinate.
348
+ * @returns The x values at y, in t-ascending order.
349
+ * @since 2.0.0
350
+ */
351
+ <XT, YT>(c: QuadraticCurve2d<XT, YT>, y: number): AtMostTwo<number>; /** @since 2.0.0 */
352
+ (y: number): {
353
+ <XT, YT extends Monotonic>(c: QuadraticCurve2d<XT, YT>): AtMostOne<number>;
354
+ <XT, YT>(c: QuadraticCurve2d<XT, YT>): AtMostTwo<number>;
355
+ };
356
+ };
357
+ /**
358
+ * Computes the derivative of a quadratic curve.
359
+ *
360
+ * @param c - The quadratic curve to compute the derivative of.
361
+ * @returns The derivative of the quadratic curve as a linear curve.
362
+ * @since 1.0.0
363
+ */
364
+ declare const derivative: (c: QuadraticCurve2d) => LinearCurve2d;
365
+ declare const curvature$1: {
366
+ /**
367
+ * Computes the curvature of the quadratic curve at a given parameter t.
368
+ *
369
+ * @param c - The quadratic curve to compute the curvature for.
370
+ * @param t - The parameter value.
371
+ * @returns The curvature of the quadratic curve at parameter t.
372
+ * @since 1.0.0
373
+ */
374
+ (c: QuadraticCurve2d, t: number): number;
375
+ /**
376
+ * Computes the curvature of the quadratic curve at a given parameter t.
377
+ *
378
+ * @param t - The parameter value.
379
+ * @returns A function that takes a quadratic curve and returns the curvature of the curve at parameter t.
380
+ * @since 1.0.0
381
+ */
382
+ (t: number): (c: QuadraticCurve2d) => number;
383
+ };
384
+ /**
385
+ * Computes the axis-aligned bounding box of the curve over its parameter
386
+ * domain `[0, 1]`. Accounts for interior extrema, so the box is tight against
387
+ * the curve and not just the control polygon.
388
+ *
389
+ * @param c - The quadratic curve.
390
+ * @returns A closed `Box2d` enclosing the curve.
391
+ * @since 2.1.0
392
+ */
393
+ declare const boundingBox$1: (c: QuadraticCurve2d) => Interval2d<Closed, Closed>;
394
+ /**
395
+ * Type-narrowing predicate: refines both axes' traits to include `Monotonic`
396
+ * when both x and y polynomials are monotonic over the unit interval `[0, 1]`.
397
+ *
398
+ * For checking only one axis, call the polynomial-level refiner directly:
399
+ * `QuadraticPolynomial.isMonotonic(curve.x, Interval.unit)`.
400
+ *
401
+ * @since 2.0.0
402
+ */
403
+ declare const isMonotonic$1: <XT, YT>(c: QuadraticCurve2d<XT, YT>) => c is QuadraticCurve2d<XT & Monotonic, YT & Monotonic>;
404
+ /** @since 2.0.0 */
405
+ declare const isIncreasing$1: <XT, YT>(c: QuadraticCurve2d<XT, YT>) => c is QuadraticCurve2d<XT & Increasing, YT & Increasing>;
406
+ /** @since 2.0.0 */
407
+ declare const isDecreasing$1: <XT, YT>(c: QuadraticCurve2d<XT, YT>) => c is QuadraticCurve2d<XT & Decreasing, YT & Decreasing>;
408
+ /** @since 2.0.0 */
409
+ declare const asMonotonic$1: <XT, YT>(c: QuadraticCurve2d<XT, YT>) => QuadraticCurve2d<XT & Monotonic, YT & Monotonic>;
410
+ /** @since 2.0.0 */
411
+ declare const asIncreasing$1: <XT, YT>(c: QuadraticCurve2d<XT, YT>) => QuadraticCurve2d<XT & Increasing, YT & Increasing>;
412
+ /** @since 2.0.0 */
413
+ declare const asDecreasing$1: <XT, YT>(c: QuadraticCurve2d<XT, YT>) => QuadraticCurve2d<XT & Decreasing, YT & Decreasing>;
414
+ //#endregion
415
+ //#region src/curve/cubic2d.internal.d.ts
416
+ declare const CubicCurve2dTypeId: unique symbol;
417
+ type CubicCurve2dTypeId = typeof CubicCurve2dTypeId;
418
+ declare namespace cubic2d_d_exports {
419
+ export { CubicCurve2d, Decreasing, Increasing, Monotonic, asDecreasing, asIncreasing, asMonotonic, boundingBox, curvature, fromBezierPoints$1 as fromBezierPoints, fromCoefficients, fromPolynomials$1 as fromPolynomials, isCubicCurve2d, isDecreasing, isIncreasing, isMonotonic, length, solve$1 as solve, solveAtX$1 as solveAtX, solveAtY$1 as solveAtY };
420
+ }
421
+ /**
422
+ * A cubic curve in 2D space.
423
+ *
424
+ * All fields are readonly and immutable, and all operations create new instances.
425
+ *
426
+ * The two type parameters carry the trait sets of the curve's per-axis
427
+ * polynomials. Refiners check monotonicity over the unit interval `[0, 1]` —
428
+ * the curve's natural parameter domain.
429
+ *
430
+ * @since 1.0.0
431
+ */
432
+ interface CubicCurve2d<out XTraits = unknown, out YTraits = unknown> extends Pipeable, TwoDimensional<CubicPolynomial<XTraits>, CubicPolynomial<YTraits>> {
433
+ readonly [CubicCurve2dTypeId]: CubicCurve2dTypeId;
434
+ }
435
+ /**
436
+ * Creates a new `CubicCurve2d` instance from polynomial parameters.
437
+ *
438
+ * @param x - The x polynomial.
439
+ * @param y - The y polynomial.
440
+ * @returns A new `CubicCurve2d` instance.
441
+ * @since 1.0.0
442
+ */
443
+ declare const fromPolynomials$1: (x: CubicPolynomial, y: CubicPolynomial) => CubicCurve2d;
444
+ /**
445
+ * Creates a new `CubicCurve2d` instance from monomial coefficient vectors.
446
+ *
447
+ * Each argument bundles the per-axis coefficient at the given power: `c0`
448
+ * holds the x⁰ term, `c1` holds the x¹ term, and so on. The resulting curve
449
+ * evaluates to `c0 + c1·t + c2·t² + c3·t³` per axis.
450
+ *
451
+ * @param c0 - The x⁰ coefficients (x and y).
452
+ * @param c1 - The x¹ coefficients (x and y).
453
+ * @param c2 - The x² coefficients (x and y).
454
+ * @param c3 - The x³ coefficients (x and y).
455
+ * @returns A new `CubicCurve2d` instance.
456
+ * @since 2.0.0
457
+ */
458
+ declare const fromCoefficients: (c0: Vector2, c1: Vector2, c2: Vector2, c3: Vector2) => CubicCurve2d;
459
+ /**
460
+ * Creates a new `CubicCurve2d` instance from cubic Bézier control points.
461
+ *
462
+ * The four arguments are the Bernstein-basis control points: `p0` and `p3` are
463
+ * the curve's endpoints and `p1` and `p2` are the off-curve control handles.
464
+ * The implementation converts to the curve's internal monomial form in closed
465
+ * form.
466
+ *
467
+ * @param p0 - The first control point (curve start).
468
+ * @param p1 - The second control point (start handle).
469
+ * @param p2 - The third control point (end handle).
470
+ * @param p3 - The fourth control point (curve end).
471
+ * @returns A new `CubicCurve2d` instance whose curve matches the given Bézier.
472
+ * @since 2.0.0
473
+ */
474
+ declare const fromBezierPoints$1: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => CubicCurve2d;
475
+ /**
476
+ * Checks if a value is a `CubicCurve2d`.
477
+ *
478
+ * @param c - The value to check.
479
+ * @returns `true` if the value is a `CubicCurve2d`, `false` otherwise.
480
+ * @since 1.0.0
481
+ */
482
+ declare const isCubicCurve2d: (c: unknown) => c is CubicCurve2d;
483
+ declare const solve$1: {
484
+ /**
485
+ * Solves the cubic curve for a given parameter t.
486
+ *
487
+ * @param t - The parameter value.
488
+ * @returns A function that takes a cubic curve and returns the point on the curve at parameter t.
489
+ * @since 1.0.0
490
+ */
491
+ (t: number): (c: CubicCurve2d) => Vector2;
492
+ /**
493
+ * Solves the cubic curve for a given parameter t.
494
+ *
495
+ * @param c - The cubic curve to solve.
496
+ * @param t - The parameter value.
497
+ * @returns The point on the curve at parameter t.
498
+ * @since 1.0.0
499
+ */
500
+ (c: CubicCurve2d, t: number): Vector2;
501
+ };
502
+ declare const length: {
503
+ /**
504
+ * Calculates (approximates) the length of a cubic curve.
505
+ *
506
+ * @param c - The cubic curve to calculate the length of.
507
+ * @param i - The interval over which to calculate the length.
508
+ * @returns The length of the cubic curve.
509
+ * @since 1.0.0
510
+ */
511
+ (c: CubicCurve2d, i: Interval): number;
512
+ /**
513
+ * Calculates (approximates) the length of a cubic curve.
514
+ *
515
+ * @param i - The interval over which to calculate the length.
516
+ * @returns A function that takes a cubic curve and returns the length of the cubic curve.
517
+ * @since 1.0.0
518
+ */
519
+ (i: Interval): (c: CubicCurve2d) => number;
520
+ };
521
+ declare const solveAtX$1: {
522
+ /**
523
+ * Evaluates the curve's y values at a given x. Because the x polynomial is
524
+ * `Monotonic`, the inverse has at most one solution — at most one y value.
525
+ *
526
+ * @param c - The cubic curve.
527
+ * @param x - The x coordinate.
528
+ * @returns Zero or one y values, in t-ascending order.
529
+ * @since 2.0.0
530
+ */
531
+ <XT extends Monotonic, YT>(c: CubicCurve2d<XT, YT>, x: number): AtMostOne<number>;
532
+ /**
533
+ * Evaluates the curve's y values at a given x. The result is the y values
534
+ * the curve passes through where x(t) = the given x — up to three solutions
535
+ * for a cubic curve.
536
+ *
537
+ * @param c - The cubic curve.
538
+ * @param x - The x coordinate.
539
+ * @returns The y values at x, in t-ascending order.
540
+ * @since 2.0.0
541
+ */
542
+ <XT, YT>(c: CubicCurve2d<XT, YT>, x: number): AtMostThree<number>; /** @since 2.0.0 */
543
+ (x: number): {
544
+ <XT extends Monotonic, YT>(c: CubicCurve2d<XT, YT>): AtMostOne<number>;
545
+ <XT, YT>(c: CubicCurve2d<XT, YT>): AtMostThree<number>;
546
+ };
547
+ };
548
+ declare const solveAtY$1: {
549
+ /**
550
+ * Evaluates the curve's x values at a given y. Because the y polynomial is
551
+ * `Monotonic`, the inverse has at most one solution.
552
+ *
553
+ * @param c - The cubic curve.
554
+ * @param y - The y coordinate.
555
+ * @returns Zero or one x values, in t-ascending order.
556
+ * @since 2.0.0
557
+ */
558
+ <XT, YT extends Monotonic>(c: CubicCurve2d<XT, YT>, y: number): AtMostOne<number>;
559
+ /**
560
+ * Evaluates the curve's x values at a given y. The result is the x values
561
+ * the curve passes through where y(t) = the given y — up to three solutions
562
+ * for a cubic curve.
563
+ *
564
+ * @param c - The cubic curve.
565
+ * @param y - The y coordinate.
566
+ * @returns The x values at y, in t-ascending order.
567
+ * @since 2.0.0
568
+ */
569
+ <XT, YT>(c: CubicCurve2d<XT, YT>, y: number): AtMostThree<number>; /** @since 2.0.0 */
570
+ (y: number): {
571
+ <XT, YT extends Monotonic>(c: CubicCurve2d<XT, YT>): AtMostOne<number>;
572
+ <XT, YT>(c: CubicCurve2d<XT, YT>): AtMostThree<number>;
573
+ };
574
+ };
575
+ declare const curvature: {
576
+ /**
577
+ * Calculates the curvature of a cubic curve at a given parameter.
578
+ *
579
+ * @param c - The cubic curve to calculate the curvature for.
580
+ * @param t - The parameter value.
581
+ * @returns The curvature of the cubic curve at parameter t.
582
+ * @since 1.0.0
583
+ */
584
+ (c: CubicCurve2d, t: number): number;
585
+ /**
586
+ * Calculates the curvature of a cubic curve at a given parameter.
587
+ *
588
+ * @param t - The parameter value.
589
+ * @returns A function that takes a cubic curve and returns the curvature of the cubic curve at parameter t.
590
+ * @since 1.0.0
591
+ */
592
+ (t: number): (c: CubicCurve2d) => number;
593
+ };
594
+ /**
595
+ * Computes the axis-aligned bounding box of the curve over its parameter
596
+ * domain `[0, 1]`. Accounts for up to two interior extrema per axis, so the
597
+ * box is tight against the curve and not just the control polygon.
598
+ *
599
+ * @param c - The cubic curve.
600
+ * @returns A closed `Box2d` enclosing the curve.
601
+ * @since 2.1.0
602
+ */
603
+ declare const boundingBox: (c: CubicCurve2d) => Interval2d<Closed, Closed>;
604
+ /**
605
+ * Type-narrowing predicate: refines both axes' traits to include `Monotonic`
606
+ * when both x and y polynomials are monotonic over the unit interval `[0, 1]`.
607
+ *
608
+ * For checking only one axis, call the polynomial-level refiner directly:
609
+ * `CubicPolynomial.isMonotonic(curve.x, Interval.unit)`.
610
+ *
611
+ * @since 2.0.0
612
+ */
613
+ declare const isMonotonic: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Monotonic, YT & Monotonic>;
614
+ /** @since 2.0.0 */
615
+ declare const isIncreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Increasing, YT & Increasing>;
616
+ /** @since 2.0.0 */
617
+ declare const isDecreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => c is CubicCurve2d<XT & Decreasing, YT & Decreasing>;
618
+ /** @since 2.0.0 */
619
+ declare const asMonotonic: <XT, YT>(c: CubicCurve2d<XT, YT>) => CubicCurve2d<XT & Monotonic, YT & Monotonic>;
620
+ /** @since 2.0.0 */
621
+ declare const asIncreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => CubicCurve2d<XT & Increasing, YT & Increasing>;
622
+ /** @since 2.0.0 */
623
+ declare const asDecreasing: <XT, YT>(c: CubicCurve2d<XT, YT>) => CubicCurve2d<XT & Decreasing, YT & Decreasing>;
624
+ //#endregion
625
+ //#region src/curve/rationalCubic2d.internal.d.ts
626
+ declare const RationalCubicCurve2dTypeId: unique symbol;
627
+ type RationalCubicCurve2dTypeId = typeof RationalCubicCurve2dTypeId;
628
+ declare const RationalCurveTraits: unique symbol;
629
+ type RationalCurveTraits = typeof RationalCurveTraits;
630
+ declare namespace rationalCubic2d_d_exports {
631
+ export { Decreasing, Increasing, Monotonic, RationalCubicCurve2d, RationalCurveTraits, approximateAsCubicCurves, fromBezierPoints, fromPolynomials, isRationalCubicCurve2d, makeMonotonicEasing, solve, solveAtX, solveAtY };
632
+ }
633
+ /**
634
+ * A rational cubic curve in 2D space.
635
+ *
636
+ * Represented as three cubic polynomials in the parameter `t`: per-axis
637
+ * numerators `x`, `y`, and a shared denominator `w`. Evaluation is
638
+ * `(x(t)/w(t), y(t)/w(t))` — the projection from homogeneous coordinates
639
+ * back to the plane. With all weights equal at the source (e.g. produced
640
+ * from a non-rational Bézier with unit weights), `w` is constant and the
641
+ * curve coincides with a polynomial cubic.
642
+ *
643
+ * The two type parameters carry per-axis monotonicity trait brands attached
644
+ * to the rational functions `x(t)/w(t)` and `y(t)/w(t)`. Unlike
645
+ * `CubicCurve2d`, traits do not flow through to the underlying polynomials —
646
+ * monotonicity of a ratio of cubics is not the same property as monotonicity
647
+ * of either cubic alone, so the brand lives on the curve itself. Constructors
648
+ * with construction-time monotonicity guarantees (e.g. {@link makeMonotonicEasing})
649
+ * return curves with `Increasing` brands attached, narrowing downstream
650
+ * operations like {@link solveAtX} to single-solution returns.
651
+ *
652
+ * All fields are readonly and immutable, and all operations create new instances.
653
+ *
654
+ * @since 2.1.0
655
+ */
656
+ interface RationalCubicCurve2d<out XTraits = unknown, out YTraits = unknown> extends Pipeable {
657
+ readonly [RationalCubicCurve2dTypeId]: RationalCubicCurve2dTypeId;
658
+ readonly [RationalCurveTraits]: [XTraits, YTraits];
659
+ readonly x: CubicPolynomial;
660
+ readonly y: CubicPolynomial;
661
+ readonly w: CubicPolynomial;
662
+ }
663
+ /**
664
+ * Checks if a value is a `RationalCubicCurve2d`.
665
+ *
666
+ * @param c - The value to check.
667
+ * @returns `true` if the value is a `RationalCubicCurve2d`, `false` otherwise.
668
+ * @since 2.1.0
669
+ */
670
+ declare const isRationalCubicCurve2d: (c: unknown) => c is RationalCubicCurve2d;
671
+ /**
672
+ * Creates a new `RationalCubicCurve2d` from per-axis numerator polynomials
673
+ * and a shared denominator polynomial.
674
+ *
675
+ * @param x - The x numerator polynomial.
676
+ * @param y - The y numerator polynomial.
677
+ * @param w - The shared denominator polynomial (must be non-zero on `[0, 1]`).
678
+ * @returns A new `RationalCubicCurve2d` instance.
679
+ * @since 2.1.0
680
+ */
681
+ declare const fromPolynomials: (x: CubicPolynomial, y: CubicPolynomial, w: CubicPolynomial) => RationalCubicCurve2d;
682
+ /**
683
+ * Creates a new `RationalCubicCurve2d` from four weighted cubic Bézier
684
+ * control points. The four control points are lifted to homogeneous form
685
+ * `(w·x, w·y, w)` and the cubic Bernstein basis is expanded into per-channel
686
+ * monomial coefficients, yielding the curve's `x`, `y`, and `w` polynomials.
687
+ *
688
+ * @param p0 - The first weighted control point (curve start).
689
+ * @param p1 - The second weighted control point (start handle).
690
+ * @param p2 - The third weighted control point (end handle).
691
+ * @param p3 - The fourth weighted control point (curve end).
692
+ * @returns A new `RationalCubicCurve2d` instance.
693
+ * @since 2.1.0
694
+ */
695
+ declare const fromBezierPoints: (p0: Weighted, p1: Weighted, p2: Weighted, p3: Weighted) => RationalCubicCurve2d;
696
+ /**
697
+ * Creates a guaranteed-monotonic rational cubic easing curve via Gregory-
698
+ * Delbourgo style construction. The result interpolates `(0, 0)` and
699
+ * `(1, 1)` with the given endpoint slopes, with `x(t) = t` pinned linearly
700
+ * and a rational cubic numerator for `y(t)`. Monotonicity of `y(t)` is
701
+ * verified rigorously at construction (degree-3 polynomial sign analysis);
702
+ * the returned curve is branded `<Increasing, Increasing>` so that
703
+ * {@link solveAtX} returns `Solution.AtMostOne<number>` without further
704
+ * trait refinement.
705
+ *
706
+ * For input slope combinations that the default Gregory-Delbourgo
707
+ * construction cannot accommodate (typically when one slope is large while
708
+ * the other is small), construction throws. Useful operating range is
709
+ * roughly `m₀, m₁ ∈ [0, 2]` with `m₀ + m₁ ≲ 3`; smoothstep (`0, 0`) and
710
+ * linear (`1, 1`) fall out as special cases.
711
+ *
712
+ * @param startSlope - The easing function's slope at the start (`dy/dx` at `x = 0`); must be finite and non-negative.
713
+ * @param endSlope - The easing function's slope at the end (`dy/dx` at `x = 1`); must be finite and non-negative.
714
+ * @returns A monotone-by-construction rational cubic easing curve.
715
+ * @throws When slopes are negative, non-finite, or produce a non-monotonic curve under the default construction.
716
+ * @since 2.1.0
717
+ */
718
+ declare const makeMonotonicEasing: (startSlope: number, endSlope: number) => RationalCubicCurve2d<Increasing, Increasing>;
719
+ declare const solve: {
720
+ /**
721
+ * Evaluates the rational cubic curve at parameter `t`. Returns
722
+ * `(x(t)/w(t), y(t)/w(t))` — three Horner evaluations and two divisions.
723
+ *
724
+ * @param c - The curve to evaluate.
725
+ * @param t - The parameter value.
726
+ * @returns The point on the curve at parameter `t`.
727
+ * @since 2.1.0
728
+ */
729
+ (c: RationalCubicCurve2d, t: number): Vector2;
730
+ /**
731
+ * Evaluates the rational cubic curve at parameter `t`.
732
+ *
733
+ * @param t - The parameter value.
734
+ * @returns A function that takes a curve and returns the point at `t`.
735
+ * @since 2.1.0
736
+ */
737
+ (t: number): (c: RationalCubicCurve2d) => Vector2;
738
+ };
739
+ declare const solveAtX: {
740
+ /**
741
+ * Evaluates the curve's y values at a given x. Because the curve's x axis
742
+ * carries the `Monotonic` brand, the inverse has at most one solution.
743
+ *
744
+ * @param c - The rational cubic curve with monotonic x.
745
+ * @param x - The x coordinate.
746
+ * @returns Zero or one y values.
747
+ * @since 2.1.0
748
+ */
749
+ <XT extends Monotonic, YT>(c: RationalCubicCurve2d<XT, YT>, x: number): AtMostOne<number>;
750
+ /**
751
+ * Evaluates the curve's y values at a given x. Up to three solutions —
752
+ * `(X(t) - x·W(t))` is a cubic polynomial in `t`.
753
+ *
754
+ * @param c - The rational cubic curve.
755
+ * @param x - The x coordinate.
756
+ * @returns The y values at x, in t-ascending order.
757
+ * @since 2.1.0
758
+ */
759
+ <XT, YT>(c: RationalCubicCurve2d<XT, YT>, x: number): AtMostThree<number>; /** @since 2.1.0 */
760
+ (x: number): {
761
+ <XT extends Monotonic, YT>(c: RationalCubicCurve2d<XT, YT>): AtMostOne<number>;
762
+ <XT, YT>(c: RationalCubicCurve2d<XT, YT>): AtMostThree<number>;
763
+ };
764
+ };
765
+ declare const solveAtY: {
766
+ /**
767
+ * Evaluates the curve's x values at a given y. Because the curve's y axis
768
+ * carries the `Monotonic` brand, the inverse has at most one solution.
769
+ *
770
+ * @param c - The rational cubic curve with monotonic y.
771
+ * @param y - The y coordinate.
772
+ * @returns Zero or one x values.
773
+ * @since 2.1.0
774
+ */
775
+ <XT, YT extends Monotonic>(c: RationalCubicCurve2d<XT, YT>, y: number): AtMostOne<number>;
776
+ /**
777
+ * Evaluates the curve's x values at a given y. Up to three solutions.
778
+ *
779
+ * @param c - The rational cubic curve.
780
+ * @param y - The y coordinate.
781
+ * @returns The x values at y, in t-ascending order.
782
+ * @since 2.1.0
783
+ */
784
+ <XT, YT>(c: RationalCubicCurve2d<XT, YT>, y: number): AtMostThree<number>; /** @since 2.1.0 */
785
+ (y: number): {
786
+ <XT, YT extends Monotonic>(c: RationalCubicCurve2d<XT, YT>): AtMostOne<number>;
787
+ <XT, YT>(c: RationalCubicCurve2d<XT, YT>): AtMostThree<number>;
788
+ };
789
+ };
790
+ declare const approximateAsCubicCurves: {
791
+ /**
792
+ * Approximates the rational cubic as a sequence of polynomial cubic curves
793
+ * via recursive subdivision. At each level a candidate polynomial cubic is
794
+ * built by projecting the segment's homogeneous Bézier control points to
795
+ * 2D; if the candidate's midpoint deviates from the true rational midpoint
796
+ * by more than `tolerance`, the segment is split at `t = 0.5` and the
797
+ * procedure recurses on each half. Returns a non-empty array; for a curve
798
+ * that is already polynomial (uniform weights) the result is a single
799
+ * exact segment.
800
+ *
801
+ * @param c - The rational cubic curve to approximate.
802
+ * @param tolerance - Maximum allowed midpoint deviation; must be positive.
803
+ * @returns A sequence of polynomial cubic curves covering the input.
804
+ * @since 2.1.0
805
+ */
806
+ (c: RationalCubicCurve2d, tolerance: number): ReadonlyArray<CubicCurve2d>;
807
+ /**
808
+ * Approximates the rational cubic as a sequence of polynomial cubic curves.
809
+ *
810
+ * @param tolerance - Maximum allowed midpoint deviation; must be positive.
811
+ * @returns A function that takes a curve and returns its polynomial approximation.
812
+ * @since 2.1.0
813
+ */
814
+ (tolerance: number): (c: RationalCubicCurve2d) => ReadonlyArray<CubicCurve2d>;
815
+ };
816
+ //#endregion
817
+ export { QuadraticCurve2d as a, linear2d_d_exports as c, cubic2d_d_exports as i, rationalCubic2d_d_exports as n, quadratic2d_d_exports as o, CubicCurve2d as r, LinearCurve2d as s, RationalCubicCurve2d as t };
818
+ //# sourceMappingURL=rationalCubic2d-DlQfBURs.d.mts.map