curvy 1.0.7 → 1.0.9

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 (109) hide show
  1. package/dist/curve/cubic2d.d.mts +80 -2
  2. package/dist/curve/cubic2d.d.ts +80 -2
  3. package/dist/curve/cubic2d.mjs +9 -26
  4. package/dist/curve/cubic2d.mjs.map +1 -0
  5. package/dist/curve/linear2d.d.mts +68 -2
  6. package/dist/curve/linear2d.d.ts +68 -2
  7. package/dist/curve/linear2d.mjs +11 -14
  8. package/dist/curve/linear2d.mjs.map +1 -0
  9. package/dist/curve/quadratic2d.d.mts +86 -2
  10. package/dist/curve/quadratic2d.d.ts +86 -2
  11. package/dist/curve/quadratic2d.mjs +10 -15
  12. package/dist/curve/quadratic2d.mjs.map +1 -0
  13. package/dist/interval.d.mts +195 -2
  14. package/dist/interval.d.ts +195 -2
  15. package/dist/interval.mjs +9 -12
  16. package/dist/interval.mjs.map +1 -0
  17. package/dist/matrix/matrix2x2.d.mts +273 -2
  18. package/dist/matrix/matrix2x2.d.ts +273 -2
  19. package/dist/matrix/matrix2x2.mjs +5 -4
  20. package/dist/matrix/matrix2x2.mjs.map +1 -0
  21. package/dist/matrix/matrix3x3.d.mts +308 -1
  22. package/dist/matrix/matrix3x3.d.ts +308 -1
  23. package/dist/matrix/matrix3x3.mjs +5 -4
  24. package/dist/matrix/matrix3x3.mjs.map +1 -0
  25. package/dist/matrix/matrix4x4.d.mts +310 -1
  26. package/dist/matrix/matrix4x4.d.ts +310 -1
  27. package/dist/matrix/matrix4x4.mjs +24 -61
  28. package/dist/matrix/matrix4x4.mjs.map +1 -0
  29. package/dist/path/cubic2d.d.mts +68 -2
  30. package/dist/path/cubic2d.d.ts +68 -2
  31. package/dist/path/cubic2d.mjs +10 -12
  32. package/dist/path/cubic2d.mjs.map +1 -0
  33. package/dist/path/linear2d.d.mts +68 -2
  34. package/dist/path/linear2d.d.ts +68 -2
  35. package/dist/path/linear2d.mjs +7 -9
  36. package/dist/path/linear2d.mjs.map +1 -0
  37. package/dist/path/quadratic2d.d.mts +67 -2
  38. package/dist/path/quadratic2d.d.ts +67 -2
  39. package/dist/path/quadratic2d.mjs +9 -13
  40. package/dist/path/quadratic2d.mjs.map +1 -0
  41. package/dist/pipe.mjs +1 -0
  42. package/dist/pipe.mjs.map +1 -0
  43. package/dist/polynomial/cubic.d.mts +1 -1
  44. package/dist/polynomial/cubic.d.ts +1 -1
  45. package/dist/polynomial/cubic.mjs +13 -28
  46. package/dist/polynomial/cubic.mjs.map +1 -0
  47. package/dist/polynomial/linear.d.mts +1 -1
  48. package/dist/polynomial/linear.d.ts +1 -1
  49. package/dist/polynomial/linear.mjs +2 -1
  50. package/dist/polynomial/linear.mjs.map +1 -0
  51. package/dist/polynomial/quadratic.d.mts +2 -2
  52. package/dist/polynomial/quadratic.d.ts +2 -2
  53. package/dist/polynomial/quadratic.mjs +5 -2
  54. package/dist/polynomial/quadratic.mjs.map +1 -0
  55. package/dist/shared/{curvy.Cps2R_RU.mjs → curvy.BkkW8Tx9.mjs} +11 -29
  56. package/dist/shared/curvy.BkkW8Tx9.mjs.map +1 -0
  57. package/dist/shared/{curvy.BzVmUIKm.mjs → curvy.BxdGW9he.mjs} +17 -32
  58. package/dist/shared/curvy.BxdGW9he.mjs.map +1 -0
  59. package/dist/shared/{curvy.C2XGH0R0.mjs → curvy.C_sCeg9J.mjs} +15 -24
  60. package/dist/shared/curvy.C_sCeg9J.mjs.map +1 -0
  61. package/dist/shared/curvy.Cg8lZVUz.d.ts +688 -0
  62. package/dist/shared/{curvy.CE4X6_Is.mjs → curvy.DCt1gGII.mjs} +11 -45
  63. package/dist/shared/curvy.DCt1gGII.mjs.map +1 -0
  64. package/dist/shared/{curvy.BZ_mTkJe.mjs → curvy.DJ4xO0al.mjs} +9 -6
  65. package/dist/shared/curvy.DJ4xO0al.mjs.map +1 -0
  66. package/dist/shared/curvy.DmVFTi0N.mjs +1 -0
  67. package/dist/shared/curvy.DmVFTi0N.mjs.map +1 -0
  68. package/dist/shared/curvy.FDaj5rlj.d.mts +688 -0
  69. package/dist/shared/{curvy.NLeFCr-9.mjs → curvy.lktriTpx.mjs} +19 -42
  70. package/dist/shared/curvy.lktriTpx.mjs.map +1 -0
  71. package/dist/shared/{curvy.Ck0of1PI.mjs → curvy.mLFprrGm.mjs} +26 -22
  72. package/dist/shared/curvy.mLFprrGm.mjs.map +1 -0
  73. package/dist/shared/{curvy.BDhiZ7He.mjs → curvy.r6f1j287.mjs} +8 -12
  74. package/dist/shared/curvy.r6f1j287.mjs.map +1 -0
  75. package/dist/splines/basis2d.d.mts +94 -2
  76. package/dist/splines/basis2d.d.ts +94 -2
  77. package/dist/splines/basis2d.mjs +13 -12
  78. package/dist/splines/basis2d.mjs.map +1 -0
  79. package/dist/splines/bezier2d.d.mts +136 -2
  80. package/dist/splines/bezier2d.d.ts +136 -2
  81. package/dist/splines/bezier2d.mjs +10 -9
  82. package/dist/splines/bezier2d.mjs.map +1 -0
  83. package/dist/splines/cardinal2d.d.mts +131 -2
  84. package/dist/splines/cardinal2d.d.ts +131 -2
  85. package/dist/splines/cardinal2d.mjs +15 -24
  86. package/dist/splines/cardinal2d.mjs.map +1 -0
  87. package/dist/splines/hermite2d.d.mts +94 -3
  88. package/dist/splines/hermite2d.d.ts +94 -3
  89. package/dist/splines/hermite2d.mjs +22 -36
  90. package/dist/splines/hermite2d.mjs.map +1 -0
  91. package/dist/utils.d.mts +179 -1
  92. package/dist/utils.d.ts +179 -1
  93. package/dist/utils.mjs +16 -7
  94. package/dist/utils.mjs.map +1 -0
  95. package/dist/vector/vector2.d.mts +259 -1
  96. package/dist/vector/vector2.d.ts +259 -1
  97. package/dist/vector/vector2.mjs +4 -2
  98. package/dist/vector/vector2.mjs.map +1 -0
  99. package/dist/vector/vector3.d.mts +345 -1
  100. package/dist/vector/vector3.d.ts +345 -1
  101. package/dist/vector/vector3.mjs +9 -2
  102. package/dist/vector/vector3.mjs.map +1 -0
  103. package/dist/vector/vector4.d.mts +163 -1
  104. package/dist/vector/vector4.d.ts +163 -1
  105. package/dist/vector/vector4.mjs +4 -2
  106. package/dist/vector/vector4.mjs.map +1 -0
  107. package/package.json +4 -4
  108. package/dist/shared/curvy.BsHoYJNv.d.ts +0 -155
  109. package/dist/shared/curvy.NsmY7zcr.d.mts +0 -155
@@ -9,40 +9,174 @@ import '../vector/vector3.mjs';
9
9
  import '../matrix/matrix2x2.mjs';
10
10
  import '../curve/cubic2d.mjs';
11
11
  import '../interval.mjs';
12
- import '../shared/curvy.NsmY7zcr.mjs';
12
+ import '../shared/curvy.FDaj5rlj.mjs';
13
13
 
14
14
  declare const Bezier2dTypeId: unique symbol;
15
15
  type Bezier2dTypeId = typeof Bezier2dTypeId;
16
16
 
17
+ /**
18
+ * A Bézier curve in 2D space.
19
+ *
20
+ * All fields are readonly and immutable, and all operations create new instances.
21
+ *
22
+ * @since 1.0.0
23
+ */
17
24
  interface Bezier2d extends Pipeable {
18
25
  readonly [Bezier2dTypeId]: Bezier2dTypeId;
19
26
  [Symbol.iterator](): IterableIterator<Vector2>;
20
27
  }
28
+ /**
29
+ * Characteristic matrix of a Bézier curve.
30
+ *
31
+ * The characteristic matrix is a 4x4 matrix that defines the shape of the Bézier curve.
32
+ *
33
+ * @since 1.0.0
34
+ */
21
35
  declare const characteristic: Matrix4x4;
36
+ /**
37
+ * Creates a new `Bezier2d` instance.
38
+ *
39
+ * @param p0 - The first control point.
40
+ * @param p1 - The second control point.
41
+ * @param p2 - The third control point.
42
+ * @param p3 - The fourth control point.
43
+ * @returns A new `Bezier2d` instance.
44
+ * @since 1.0.0
45
+ */
22
46
  declare const make: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => Bezier2d;
47
+ /**
48
+ * Creates a new `Bezier2d` instance from an array of control points.
49
+ *
50
+ * @param points - The control points.
51
+ * @returns A new `Bezier2d` instance.
52
+ * @since 1.0.0
53
+ */
23
54
  declare const fromArray: (points: ReadonlyArray<Vector2>) => Bezier2d;
55
+ /**
56
+ * Creates a new `Bezier2d` instance from an iterable of control points and the characteristic matrix associated with the control points.
57
+ *
58
+ * @param points - The control points.
59
+ * @param matrix - The characteristic matrix.
60
+ * @param stride - The stride of the control points.
61
+ * @returns A new `Bezier2d` instance.
62
+ * @since 1.0.0
63
+ */
24
64
  declare const fromSpline: (points: Iterable<Vector2>, matrix: Matrix4x4, stride: 1 | 2 | 3) => Bezier2d;
65
+ /**
66
+ * Checks if a value is a `Bezier2d`.
67
+ *
68
+ * @param p - The value to check.
69
+ * @returns `true` if the value is a `Bezier2d`, `false` otherwise.
70
+ * @since 1.0.0
71
+ */
25
72
  declare const isCubicBezier2d: (p: unknown) => p is Bezier2d;
26
73
  declare const append: {
74
+ /**
75
+ * Appends control points to a `Bezier2d`.
76
+ *
77
+ * @param p1 - The second control point (first tangent).
78
+ * @param p2 - The third control point (second tangent).
79
+ * @param p3 - The fourth control point (end point).
80
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
81
+ */
27
82
  (p1: Vector2, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
83
+ /**
84
+ * Appends control points to a `Bezier2d`.
85
+ *
86
+ * @param p - The `Bezier2d` to append the control points to.
87
+ * @param p1 - The second control point (first tangent).
88
+ * @param p2 - The third control point (second tangent).
89
+ * @param p3 - The fourth control point (end point).
90
+ * @returns A new `Bezier2d` instance with the appended control points.
91
+ */
28
92
  (p: Bezier2d, p1: Vector2, p2: Vector2, p3: Vector2): Bezier2d;
29
93
  };
30
94
  declare const appendTangentAligned: {
95
+ /**
96
+ * Appends control points to a `Bezier2d` with aligned tangents.
97
+ *
98
+ * @param ratio - The ratio of the tangents.
99
+ * @param p2 - The third control point (second tangent).
100
+ * @param p3 - The fourth control point (end point).
101
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
102
+ */
31
103
  (ratio: number, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
104
+ /**
105
+ * Appends control points to a `Bezier2d` with aligned tangents.
106
+ *
107
+ * @param p - The `Bezier2d` to append the control points to.
108
+ * @param ratio - The ratio of the tangents.
109
+ * @param p2 - The third control point (second tangent).
110
+ * @param p3 - The fourth control point (end point).
111
+ * @returns A new `Bezier2d` instance with the appended control points.
112
+ */
32
113
  (p: Bezier2d, ratio: number, p2: Vector2, p3: Vector2): Bezier2d;
33
114
  };
34
115
  declare const appendCurvatureMirrored: {
116
+ /**
117
+ * Appends control points to a `Bezier2d` with mirrored curvature.
118
+ *
119
+ * @param a - The first curvature parameter.
120
+ * @param b - The second curvature parameter.
121
+ * @param p6 - The sixth control point (end point).
122
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
123
+ */
35
124
  (a: number, b: number, p6: Vector2): (p: Bezier2d) => Bezier2d;
125
+ /**
126
+ * Appends control points to a `Bezier2d` with mirrored curvature.
127
+ *
128
+ * @param p - The `Bezier2d` to append the control points to.
129
+ * @param a - The first curvature parameter.
130
+ * @param b - The second curvature parameter.
131
+ * @param p6 - The sixth control point (end point).
132
+ * @returns A new `Bezier2d` instance with the appended control points.
133
+ */
36
134
  (p: Bezier2d, a: number, b: number, p6: Vector2): Bezier2d;
37
135
  };
38
136
  declare const appendVelocityAligned: {
137
+ /**
138
+ * Appends control points to a `Bezier2d` with aligned velocity.
139
+ *
140
+ * @param p2 - The second control point (first tangent).
141
+ * @param p3 - The third control point (second tangent).
142
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
143
+ */
39
144
  (p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
145
+ /**
146
+ * Appends control points to a `Bezier2d` with aligned velocity.
147
+ *
148
+ * @param p - The `Bezier2d` to append the control points to.
149
+ * @param p2 - The second control point (first tangent).
150
+ * @param p3 - The third control point (second tangent).
151
+ * @returns A new `Bezier2d` instance with the appended control points.
152
+ */
40
153
  (p: Bezier2d, p2: Vector2, p3: Vector2): Bezier2d;
41
154
  };
42
155
  declare const appendAccelerationAligned: {
156
+ /**
157
+ * Appends control points to a `Bezier2d` with aligned acceleration.
158
+ *
159
+ * @param p3 - The third control point (second tangent).
160
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
161
+ */
43
162
  (p3: Vector2): (p: Bezier2d) => Bezier2d;
163
+ /**
164
+ * Appends control points to a `Bezier2d` with aligned acceleration.
165
+ *
166
+ * @param p - The `Bezier2d` to append the control points to.
167
+ * @param p3 - The third control point (second tangent).
168
+ * @returns A new `Bezier2d` instance with the appended control points.
169
+ */
44
170
  (p: Bezier2d, p3: Vector2): Bezier2d;
45
171
  };
172
+ /**
173
+ * Converts a `Bezier2d` to a `CubicPath2d`.
174
+ *
175
+ * @param p - The `Bezier2d` to convert.
176
+ * @returns A new `CubicPath2d` instance representing the same curve as the `Bezier2d`.
177
+ * @since 1.0.0
178
+ */
46
179
  declare const toPath: (p: Bezier2d) => CubicPath2d;
47
180
 
48
- export { type Bezier2d, append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, characteristic, fromArray, fromSpline, isCubicBezier2d, make, toPath };
181
+ export { append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, characteristic, fromArray, fromSpline, isCubicBezier2d, make, toPath };
182
+ export type { Bezier2d };
@@ -9,40 +9,174 @@ import '../vector/vector3.js';
9
9
  import '../matrix/matrix2x2.js';
10
10
  import '../curve/cubic2d.js';
11
11
  import '../interval.js';
12
- import '../shared/curvy.BsHoYJNv.js';
12
+ import '../shared/curvy.Cg8lZVUz.js';
13
13
 
14
14
  declare const Bezier2dTypeId: unique symbol;
15
15
  type Bezier2dTypeId = typeof Bezier2dTypeId;
16
16
 
17
+ /**
18
+ * A Bézier curve in 2D space.
19
+ *
20
+ * All fields are readonly and immutable, and all operations create new instances.
21
+ *
22
+ * @since 1.0.0
23
+ */
17
24
  interface Bezier2d extends Pipeable {
18
25
  readonly [Bezier2dTypeId]: Bezier2dTypeId;
19
26
  [Symbol.iterator](): IterableIterator<Vector2>;
20
27
  }
28
+ /**
29
+ * Characteristic matrix of a Bézier curve.
30
+ *
31
+ * The characteristic matrix is a 4x4 matrix that defines the shape of the Bézier curve.
32
+ *
33
+ * @since 1.0.0
34
+ */
21
35
  declare const characteristic: Matrix4x4;
36
+ /**
37
+ * Creates a new `Bezier2d` instance.
38
+ *
39
+ * @param p0 - The first control point.
40
+ * @param p1 - The second control point.
41
+ * @param p2 - The third control point.
42
+ * @param p3 - The fourth control point.
43
+ * @returns A new `Bezier2d` instance.
44
+ * @since 1.0.0
45
+ */
22
46
  declare const make: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => Bezier2d;
47
+ /**
48
+ * Creates a new `Bezier2d` instance from an array of control points.
49
+ *
50
+ * @param points - The control points.
51
+ * @returns A new `Bezier2d` instance.
52
+ * @since 1.0.0
53
+ */
23
54
  declare const fromArray: (points: ReadonlyArray<Vector2>) => Bezier2d;
55
+ /**
56
+ * Creates a new `Bezier2d` instance from an iterable of control points and the characteristic matrix associated with the control points.
57
+ *
58
+ * @param points - The control points.
59
+ * @param matrix - The characteristic matrix.
60
+ * @param stride - The stride of the control points.
61
+ * @returns A new `Bezier2d` instance.
62
+ * @since 1.0.0
63
+ */
24
64
  declare const fromSpline: (points: Iterable<Vector2>, matrix: Matrix4x4, stride: 1 | 2 | 3) => Bezier2d;
65
+ /**
66
+ * Checks if a value is a `Bezier2d`.
67
+ *
68
+ * @param p - The value to check.
69
+ * @returns `true` if the value is a `Bezier2d`, `false` otherwise.
70
+ * @since 1.0.0
71
+ */
25
72
  declare const isCubicBezier2d: (p: unknown) => p is Bezier2d;
26
73
  declare const append: {
74
+ /**
75
+ * Appends control points to a `Bezier2d`.
76
+ *
77
+ * @param p1 - The second control point (first tangent).
78
+ * @param p2 - The third control point (second tangent).
79
+ * @param p3 - The fourth control point (end point).
80
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
81
+ */
27
82
  (p1: Vector2, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
83
+ /**
84
+ * Appends control points to a `Bezier2d`.
85
+ *
86
+ * @param p - The `Bezier2d` to append the control points to.
87
+ * @param p1 - The second control point (first tangent).
88
+ * @param p2 - The third control point (second tangent).
89
+ * @param p3 - The fourth control point (end point).
90
+ * @returns A new `Bezier2d` instance with the appended control points.
91
+ */
28
92
  (p: Bezier2d, p1: Vector2, p2: Vector2, p3: Vector2): Bezier2d;
29
93
  };
30
94
  declare const appendTangentAligned: {
95
+ /**
96
+ * Appends control points to a `Bezier2d` with aligned tangents.
97
+ *
98
+ * @param ratio - The ratio of the tangents.
99
+ * @param p2 - The third control point (second tangent).
100
+ * @param p3 - The fourth control point (end point).
101
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
102
+ */
31
103
  (ratio: number, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
104
+ /**
105
+ * Appends control points to a `Bezier2d` with aligned tangents.
106
+ *
107
+ * @param p - The `Bezier2d` to append the control points to.
108
+ * @param ratio - The ratio of the tangents.
109
+ * @param p2 - The third control point (second tangent).
110
+ * @param p3 - The fourth control point (end point).
111
+ * @returns A new `Bezier2d` instance with the appended control points.
112
+ */
32
113
  (p: Bezier2d, ratio: number, p2: Vector2, p3: Vector2): Bezier2d;
33
114
  };
34
115
  declare const appendCurvatureMirrored: {
116
+ /**
117
+ * Appends control points to a `Bezier2d` with mirrored curvature.
118
+ *
119
+ * @param a - The first curvature parameter.
120
+ * @param b - The second curvature parameter.
121
+ * @param p6 - The sixth control point (end point).
122
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
123
+ */
35
124
  (a: number, b: number, p6: Vector2): (p: Bezier2d) => Bezier2d;
125
+ /**
126
+ * Appends control points to a `Bezier2d` with mirrored curvature.
127
+ *
128
+ * @param p - The `Bezier2d` to append the control points to.
129
+ * @param a - The first curvature parameter.
130
+ * @param b - The second curvature parameter.
131
+ * @param p6 - The sixth control point (end point).
132
+ * @returns A new `Bezier2d` instance with the appended control points.
133
+ */
36
134
  (p: Bezier2d, a: number, b: number, p6: Vector2): Bezier2d;
37
135
  };
38
136
  declare const appendVelocityAligned: {
137
+ /**
138
+ * Appends control points to a `Bezier2d` with aligned velocity.
139
+ *
140
+ * @param p2 - The second control point (first tangent).
141
+ * @param p3 - The third control point (second tangent).
142
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
143
+ */
39
144
  (p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
145
+ /**
146
+ * Appends control points to a `Bezier2d` with aligned velocity.
147
+ *
148
+ * @param p - The `Bezier2d` to append the control points to.
149
+ * @param p2 - The second control point (first tangent).
150
+ * @param p3 - The third control point (second tangent).
151
+ * @returns A new `Bezier2d` instance with the appended control points.
152
+ */
40
153
  (p: Bezier2d, p2: Vector2, p3: Vector2): Bezier2d;
41
154
  };
42
155
  declare const appendAccelerationAligned: {
156
+ /**
157
+ * Appends control points to a `Bezier2d` with aligned acceleration.
158
+ *
159
+ * @param p3 - The third control point (second tangent).
160
+ * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
161
+ */
43
162
  (p3: Vector2): (p: Bezier2d) => Bezier2d;
163
+ /**
164
+ * Appends control points to a `Bezier2d` with aligned acceleration.
165
+ *
166
+ * @param p - The `Bezier2d` to append the control points to.
167
+ * @param p3 - The third control point (second tangent).
168
+ * @returns A new `Bezier2d` instance with the appended control points.
169
+ */
44
170
  (p: Bezier2d, p3: Vector2): Bezier2d;
45
171
  };
172
+ /**
173
+ * Converts a `Bezier2d` to a `CubicPath2d`.
174
+ *
175
+ * @param p - The `Bezier2d` to convert.
176
+ * @returns A new `CubicPath2d` instance representing the same curve as the `Bezier2d`.
177
+ * @since 1.0.0
178
+ */
46
179
  declare const toPath: (p: Bezier2d) => CubicPath2d;
47
180
 
48
- export { type Bezier2d, append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, characteristic, fromArray, fromSpline, isCubicBezier2d, make, toPath };
181
+ export { append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, characteristic, fromArray, fromSpline, isCubicBezier2d, make, toPath };
182
+ export type { Bezier2d };
@@ -1,22 +1,23 @@
1
- export { b as append, h as appendAccelerationAligned, e as appendCurvatureMirrored, d as appendTangentAligned, g as appendVelocityAligned, c as characteristic, a as fromArray, f as fromSpline, i as isCubicBezier2d, m as make, j as toPath } from '../shared/curvy.CE4X6_Is.mjs';
1
+ export { b as append, h as appendAccelerationAligned, e as appendCurvatureMirrored, d as appendTangentAligned, g as appendVelocityAligned, c as characteristic, a as fromArray, f as fromSpline, i as isCubicBezier2d, m as make, j as toPath } from '../shared/curvy.DCt1gGII.mjs';
2
2
  import '../matrix/matrix4x4.mjs';
3
- import '../shared/curvy.Cps2R_RU.mjs';
3
+ import '../shared/curvy.BkkW8Tx9.mjs';
4
4
  import '../utils.mjs';
5
5
  import '../pipe.mjs';
6
- import '../shared/curvy.BZ_mTkJe.mjs';
7
- import '../shared/curvy.C2XGH0R0.mjs';
8
- import '../shared/curvy.NLeFCr-9.mjs';
9
- import '../shared/curvy.Ck0of1PI.mjs';
6
+ import '../shared/curvy.DJ4xO0al.mjs';
7
+ import '../shared/curvy.C_sCeg9J.mjs';
8
+ import '../shared/curvy.lktriTpx.mjs';
9
+ import '../shared/curvy.mLFprrGm.mjs';
10
10
  import '../path/cubic2d.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
13
  import '../shared/curvy.DmVFTi0N.mjs';
14
14
  import '../polynomial/cubic.mjs';
15
- import '../shared/curvy.BzVmUIKm.mjs';
16
- import '../shared/curvy.BDhiZ7He.mjs';
17
- import '../polynomial/quadratic.mjs';
15
+ import '../shared/curvy.BxdGW9he.mjs';
18
16
  import '../vector/vector2.mjs';
17
+ import '../shared/curvy.r6f1j287.mjs';
18
+ import '../polynomial/quadratic.mjs';
19
19
  import '../curve/linear2d.mjs';
20
20
  import '../polynomial/linear.mjs';
21
21
  import '../curve/quadratic2d.mjs';
22
22
  import '../vector/vector4.mjs';
23
+ //# sourceMappingURL=bezier2d.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bezier2d.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -10,40 +10,169 @@ import '../vector/vector3.mjs';
10
10
  import '../matrix/matrix2x2.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
- import '../shared/curvy.NsmY7zcr.mjs';
13
+ import '../shared/curvy.FDaj5rlj.mjs';
14
14
 
15
15
  declare const Cardinal2dTypeId: unique symbol;
16
16
  type Cardinal2dTypeId = typeof Cardinal2dTypeId;
17
17
 
18
+ /**
19
+ * A Cardinal spline in 2D space.
20
+ *
21
+ * All fields are readonly and immutable, and all operations create new instances.
22
+ *
23
+ * @since 1.0.0
24
+ */
18
25
  interface Cardinal2d extends Pipeable {
19
26
  readonly [Cardinal2dTypeId]: Cardinal2dTypeId;
20
27
  [Symbol.iterator](): IterableIterator<Vector2>;
21
28
  }
29
+ /**
30
+ * The characteristic matrix of a Cardinal spline.
31
+ *
32
+ * The characteristic matrix is a 4x4 matrix that defines the shape of the spline.
33
+ *
34
+ * @param scale - The tension of the spline.
35
+ * @returns The characteristic matrix.
36
+ * @since 1.0.0
37
+ */
22
38
  declare const characteristic: (scale: number) => Matrix4x4;
39
+ /**
40
+ * The characteristic matrix of a Catmull-Rom spline.
41
+ *
42
+ * The characteristic matrix is a 4x4 matrix that defines the shape of the spline.
43
+ *
44
+ * @since 1.0.0
45
+ */
23
46
  declare const catRomCharacteristic: Matrix4x4;
47
+ /**
48
+ * Checks if a value is a `Cardinal2d`.
49
+ *
50
+ * @param p - The value to check.
51
+ * @returns `true` if the value is a `Cardinal2d`, `false` otherwise.
52
+ * @since 1.0.0
53
+ */
24
54
  declare const isCardinal2d: (p: unknown) => p is Cardinal2d;
55
+ /**
56
+ * Creates a new `Cardinal2d` instance.
57
+ *
58
+ * @param p0 - The first control point.
59
+ * @param p1 - The second control point.
60
+ * @param points - The remaining control points.
61
+ * @returns A new `Cardinal2d` instance.
62
+ * @since 1.0.0
63
+ */
25
64
  declare const make: (p0: Vector2, p1: Vector2, ...points: ReadonlyArray<Vector2>) => Cardinal2d;
65
+ /**
66
+ * Creates a new `Cardinal2d` instance from an array of control points.
67
+ *
68
+ * @param points - The control points.
69
+ * @returns A new `Cardinal2d` instance.
70
+ * @since 1.0.0
71
+ */
26
72
  declare const fromArray: (points: ReadonlyArray<Vector2>) => Cardinal2d;
27
73
  declare const append: {
74
+ /**
75
+ * Appends control points to a `Cardinal2d`.
76
+ *
77
+ * @param points - The control points to append.
78
+ * @returns A function that takes a `Cardinal2d` and returns a new `Cardinal2d` instance with the appended control points.
79
+ * @since 1.0.0
80
+ */
28
81
  (...points: ReadonlyArray<Vector2>): (c: Cardinal2d) => Cardinal2d;
82
+ /**
83
+ * Appends control points to a `Cardinal2d`.
84
+ *
85
+ * @param c - The `Cardinal2d` to append the control points to.
86
+ * @param points - The control points to append.
87
+ * @returns A new `Cardinal2d` instance with the appended control points.
88
+ * @since 1.0.0
89
+ */
29
90
  (c: Cardinal2d, ...points: ReadonlyArray<Vector2>): Cardinal2d;
30
91
  };
31
92
  declare const prepend: {
93
+ /**
94
+ * Prepends control points to a `Cardinal2d`.
95
+ *
96
+ * @param points - The control points to prepend.
97
+ * @returns A function that takes a `Cardinal2d` and returns a new `Cardinal2d` instance with the prepended control points.
98
+ * @since 1.0.0
99
+ */
32
100
  (...points: ReadonlyArray<Vector2>): (c: Cardinal2d) => Cardinal2d;
101
+ /**
102
+ * Prepends control points to a `Cardinal2d`.
103
+ *
104
+ * @param c - The `Cardinal2d` to prepend the control points to.
105
+ * @param points - The control points to prepend.
106
+ * @returns A new `Cardinal2d` instance with the prepended control points.
107
+ * @since 1.0.0
108
+ */
33
109
  (c: Cardinal2d, ...points: ReadonlyArray<Vector2>): Cardinal2d;
34
110
  };
111
+ /**
112
+ * Doubles the endpoints of a `Cardinal2d` spline.
113
+ *
114
+ * @param c - The `Cardinal2d` to duplicate the endpoints of.
115
+ * @returns A new `Cardinal2d` instance with the duplicated endpoints.
116
+ * @since 1.0.0
117
+ */
35
118
  declare const withDuplicatedEndpoints: (c: Cardinal2d) => Cardinal2d;
36
119
  declare const withReflectedEndpoints: {
120
+ /**
121
+ * Reflects the endpoints of a `Cardinal2d` spline.
122
+ *
123
+ * @param scale - The scale factor for the reflection.
124
+ * @returns A function that takes a `Cardinal2d` and returns a new `Cardinal2d` instance with the reflected endpoints.
125
+ * @since 1.0.0
126
+ */
37
127
  (scale: number): (c: Cardinal2d) => Cardinal2d;
128
+ /**
129
+ * Reflects the endpoints of a `Cardinal2d` spline.
130
+ *
131
+ * @param c - The `Cardinal2d` to reflect the endpoints of.
132
+ * @param scale - The scale factor for the reflection.
133
+ * @returns A new `Cardinal2d` instance with the reflected endpoints.
134
+ * @since 1.0.0
135
+ */
38
136
  (c: Cardinal2d, scale?: number): Cardinal2d;
39
137
  };
40
138
  declare const toPath: {
139
+ /**
140
+ * Converts a `Cardinal2d` to a `CubicPath2d`.
141
+ *
142
+ * @param scale - The scale factor for the conversion.
143
+ * @returns A Function that takes a `Cardinal2d` and returns a new `CubicPath2d` instance.
144
+ * @since 1.0.0
145
+ */
41
146
  (scale: number): (c: Cardinal2d) => CubicPath2d;
147
+ /**
148
+ * Converts a `Cardinal2d` to a `CubicPath2d`.
149
+ *
150
+ * @param c - The `Cardinal2d` to convert.
151
+ * @param scale - The scale factor for the conversion.
152
+ * @returns A new `CubicPath2d` instance representing the same curve as the `Cardinal2d`.
153
+ * @since 1.0.0
154
+ */
42
155
  (c: Cardinal2d, scale?: number): CubicPath2d;
43
156
  };
44
157
  declare const toBezier: {
158
+ /**
159
+ * Converts a `Cardinal2d` to a `Bezier2d`.
160
+ *
161
+ * @param p - The `Cardinal2d` to convert.
162
+ * @returns A new `Bezier2d` instance representing the same curve as the `Cardinal2d`.
163
+ * @since 1.0.0
164
+ */
45
165
  (p: Cardinal2d): Bezier2d;
166
+ /**
167
+ * Converts a `Cardinal2d` to a `Bezier2d`.
168
+ *
169
+ * @param p - The `Cardinal2d` to convert.
170
+ * @param scale - The scale factor for the conversion.
171
+ * @returns A new `Bezier2d` instance representing the same curve as the `Cardinal2d`.
172
+ * @since 1.0.0
173
+ */
46
174
  (p: Cardinal2d, scale: number): Bezier2d;
47
175
  };
48
176
 
49
- export { type Cardinal2d, append, catRomCharacteristic, characteristic, fromArray, isCardinal2d, make, prepend, toBezier, toPath, withDuplicatedEndpoints, withReflectedEndpoints };
177
+ export { append, catRomCharacteristic, characteristic, fromArray, isCardinal2d, make, prepend, toBezier, toPath, withDuplicatedEndpoints, withReflectedEndpoints };
178
+ export type { Cardinal2d };