curvy 2.0.0-alpha.0 → 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.
- package/dist/characteristic/index.d.mts +3 -3
- package/dist/characteristic/index.mjs +1 -1
- package/dist/curve/index.d.mts +1 -1
- package/dist/curve/index.mjs +1 -1
- package/dist/interval/index.d.mts +3 -2
- package/dist/interval/index.mjs +3 -2
- package/dist/matrix/index.d.mts +1 -1
- package/dist/number.mjs.map +1 -1
- package/dist/path/index.d.mts +26 -6
- package/dist/path/index.mjs +36 -3
- package/dist/path/index.mjs.map +1 -1
- package/dist/polynomial/index.d.mts +1 -1
- package/dist/polynomial/index.mjs +2 -2
- package/dist/shared/{characteristic-BGRxcxUH.mjs → characteristic-B9nCh_cx.mjs} +2 -2
- package/dist/shared/{characteristic-BGRxcxUH.mjs.map → characteristic-B9nCh_cx.mjs.map} +1 -1
- package/dist/shared/{cubic-Dfn6DB02.d.mts → cubic-BajUY0JT.d.mts} +12 -11
- package/dist/shared/{cubic-CYYEUHNm.mjs → cubic-CpHAx8cC.mjs} +5 -5
- package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
- package/dist/shared/{interval-CCEqzPgA.mjs → interval-05CR6eBf.mjs} +47 -2
- package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
- package/dist/shared/{interval-hQDiKqj0.d.mts → interval-Dy-RMEE3.d.mts} +43 -4
- package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
- package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
- package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
- package/dist/shared/{matrix4x4-Bt_DBlP0.d.mts → matrix4x4-Dm_tSiH1.d.mts} +4 -3
- package/dist/shared/{quadratic-DEhuAKuE.mjs → quadratic-CamozcFc.mjs} +3 -3
- package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
- package/dist/shared/{rationalCubic2d-D_-XWxcm.d.mts → rationalCubic2d-B6g97ryJ.d.mts} +16 -5
- package/dist/shared/{rationalCubic2d-CXa7Yren.mjs → rationalCubic2d-BEgUGSFf.mjs} +20 -3
- package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
- package/dist/shared/{rationalCubic2d-CP4oGpnk.mjs → rationalCubic2d-Bys2Uory.mjs} +44 -7
- package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
- package/dist/shared/{rationalCubic2d-BPLohNuI.d.mts → rationalCubic2d-DlQfBURs.d.mts} +40 -9
- package/dist/shared/{solution-CbSWzXCn.mjs → solution-CrtLfqEq.mjs} +2 -2
- package/dist/shared/{solution-CbSWzXCn.mjs.map → solution-CrtLfqEq.mjs.map} +1 -1
- package/dist/shared/{solution-BjoW7ov4.d.mts → solution-sNQ-ZVhN.d.mts} +3 -3
- package/dist/shared/{utils-DqTGyXrP.d.mts → utils-MCckigYk.d.mts} +1 -1
- package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
- package/dist/shared/{vector2-TV0UnlxY.d.mts → vector3-DqeOZtOB.d.mts} +43 -508
- package/dist/solution/index.d.mts +1 -1
- package/dist/solution/index.mjs +1 -1
- package/dist/splines/index.d.mts +4 -4
- package/dist/splines/index.mjs +4 -4
- package/dist/utils.d.mts +1 -1
- package/dist/vector/index.d.mts +2 -1
- package/package.json +1 -1
- package/dist/shared/cubic-CYYEUHNm.mjs.map +0 -1
- package/dist/shared/interval-CCEqzPgA.mjs.map +0 -1
- package/dist/shared/quadratic-DEhuAKuE.mjs.map +0 -1
- package/dist/shared/rationalCubic2d-CP4oGpnk.mjs.map +0 -1
- package/dist/shared/rationalCubic2d-CXa7Yren.mjs.map +0 -1
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { t as Pipeable } from "./utils-MCckigYk.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/dimensions.d.ts
|
|
4
|
+
type TwoDimensionalIndex = 0 | 1;
|
|
5
|
+
type TwoDimensionalComponent = 'x' | 'y';
|
|
6
|
+
interface TwoDimensional<out T1, out T2 = T1> {
|
|
7
|
+
readonly x: T1;
|
|
8
|
+
readonly y: T2;
|
|
9
|
+
readonly 0: T1;
|
|
10
|
+
readonly 1: T2;
|
|
11
|
+
}
|
|
12
|
+
type ThreeDimensionalIndex = TwoDimensionalIndex | 2;
|
|
13
|
+
type ThreeDimensionalComponent = TwoDimensionalComponent | 'z';
|
|
14
|
+
interface ThreeDimensional<out T1, out T2 = T1, out T3 = T2> extends TwoDimensional<T1, T2> {
|
|
15
|
+
readonly z: T3;
|
|
16
|
+
readonly 2: T3;
|
|
17
|
+
}
|
|
18
|
+
type FourDimensionalIndex = ThreeDimensionalIndex | 3;
|
|
19
|
+
type FourDimensionalComponent = ThreeDimensionalComponent | 'w';
|
|
20
|
+
interface FourDimensional<out T1, out T2 = T1, out T3 = T2, out T4 = T3> extends ThreeDimensional<T1, T2, T3> {
|
|
21
|
+
readonly w: T4;
|
|
22
|
+
readonly 3: T4;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/vector/vector2.internal.d.ts
|
|
26
|
+
declare const Vector2TypeId: unique symbol;
|
|
27
|
+
type Vector2TypeId = typeof Vector2TypeId;
|
|
28
|
+
declare const WeightedVector2TypeId: unique symbol;
|
|
29
|
+
type WeightedVector2TypeId = typeof WeightedVector2TypeId;
|
|
30
|
+
declare namespace vector2_d_exports {
|
|
31
|
+
export { Vector2, Weighted, add, components, cross, dot, equals, fromPolar, getR, getTheta, getX, getY, hadamard, isVector2, isWeighted, magnitude, make, makeWeighted, normalize, scale, setR, setTheta, setX, setY, softmax, subtract, transpose, unit, unweighted, weightedEquals, withWeight, zero };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A 2D vector.
|
|
35
|
+
*
|
|
36
|
+
* All fields are readonly and immutable, and all operations create new instances.
|
|
37
|
+
*
|
|
38
|
+
* @since 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
interface Vector2 extends Pipeable, TwoDimensional<number> {
|
|
41
|
+
readonly [Vector2TypeId]: Vector2TypeId;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A 2D point with an associated positive scalar weight.
|
|
45
|
+
*
|
|
46
|
+
* Used by rational primitives (e.g. `RationalBezier2d`) where each control
|
|
47
|
+
* point carries an influence weight. The interface is structurally distinct
|
|
48
|
+
* from `Vector2` — its brand prevents accidental use with vector arithmetic
|
|
49
|
+
* (`add`, `subtract`, `scale`, etc.) where weighted operations are not
|
|
50
|
+
* well-defined.
|
|
51
|
+
*
|
|
52
|
+
* Construct via {@link makeWeighted} (from raw components) or
|
|
53
|
+
* {@link withWeight} (from an existing `Vector2`).
|
|
54
|
+
*
|
|
55
|
+
* @since 2.1.0
|
|
56
|
+
*/
|
|
57
|
+
interface Weighted extends Pipeable {
|
|
58
|
+
readonly [WeightedVector2TypeId]: WeightedVector2TypeId;
|
|
59
|
+
readonly x: number;
|
|
60
|
+
readonly y: number;
|
|
61
|
+
readonly weight: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a value is a `Vector2`.
|
|
65
|
+
*
|
|
66
|
+
* @param v - The value to check.
|
|
67
|
+
* @returns `true` if the value is a `Vector2`, `false` otherwise.
|
|
68
|
+
* @since 1.0.0
|
|
69
|
+
*/
|
|
70
|
+
declare const isVector2: (v: unknown) => v is Vector2;
|
|
71
|
+
/**
|
|
72
|
+
* Checks if a value is a `Vector2.Weighted`.
|
|
73
|
+
*
|
|
74
|
+
* @param v - The value to check.
|
|
75
|
+
* @returns `true` if the value is a `Vector2.Weighted`, `false` otherwise.
|
|
76
|
+
* @since 2.1.0
|
|
77
|
+
*/
|
|
78
|
+
declare const isWeighted: (v: unknown) => v is Weighted;
|
|
79
|
+
/**
|
|
80
|
+
* Creates a new `Vector2.Weighted` from raw components. The weight must be
|
|
81
|
+
* finite and positive.
|
|
82
|
+
*
|
|
83
|
+
* @param x - The x component.
|
|
84
|
+
* @param y - The y component.
|
|
85
|
+
* @param weight - The positive scalar weight.
|
|
86
|
+
* @returns A new `Vector2.Weighted` instance.
|
|
87
|
+
* @since 2.1.0
|
|
88
|
+
*/
|
|
89
|
+
declare const makeWeighted: (x: number, y: number, weight: number) => Weighted;
|
|
90
|
+
declare const withWeight: {
|
|
91
|
+
/**
|
|
92
|
+
* Promotes a `Vector2` to a `Vector2.Weighted` by attaching the given
|
|
93
|
+
* positive scalar weight.
|
|
94
|
+
*
|
|
95
|
+
* @param v - The point to weight.
|
|
96
|
+
* @param weight - The positive scalar weight.
|
|
97
|
+
* @returns A new `Vector2.Weighted` instance.
|
|
98
|
+
* @since 2.1.0
|
|
99
|
+
*/
|
|
100
|
+
(v: Vector2, weight: number): Weighted;
|
|
101
|
+
/**
|
|
102
|
+
* Promotes a `Vector2` to a `Vector2.Weighted` by attaching the given
|
|
103
|
+
* positive scalar weight.
|
|
104
|
+
*
|
|
105
|
+
* @param weight - The positive scalar weight.
|
|
106
|
+
* @returns A function that takes a `Vector2` and returns a weighted point.
|
|
107
|
+
* @since 2.1.0
|
|
108
|
+
*/
|
|
109
|
+
(weight: number): (v: Vector2) => Weighted;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Strips the weight from a `Vector2.Weighted`, returning the underlying point.
|
|
113
|
+
*
|
|
114
|
+
* @param w - The weighted point.
|
|
115
|
+
* @returns A new `Vector2` instance with the same x and y components.
|
|
116
|
+
* @since 2.1.0
|
|
117
|
+
*/
|
|
118
|
+
declare const unweighted: (w: Weighted) => Vector2;
|
|
119
|
+
declare const weightedEquals: {
|
|
120
|
+
/**
|
|
121
|
+
* Checks if two `Vector2.Weighted` instances are approximately equal —
|
|
122
|
+
* point components and weight all within the default absolute tolerance.
|
|
123
|
+
*
|
|
124
|
+
* @param a - The first weighted point.
|
|
125
|
+
* @param b - The second weighted point.
|
|
126
|
+
* @returns `true` when components and weight are within tolerance.
|
|
127
|
+
* @since 2.1.0
|
|
128
|
+
*/
|
|
129
|
+
(a: Weighted, b: Weighted): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Checks if two `Vector2.Weighted` instances are approximately equal.
|
|
132
|
+
*
|
|
133
|
+
* @param b - The second weighted point.
|
|
134
|
+
* @returns A function that takes the first weighted point and returns the comparison result.
|
|
135
|
+
* @since 2.1.0
|
|
136
|
+
*/
|
|
137
|
+
(b: Weighted): (a: Weighted) => boolean;
|
|
138
|
+
};
|
|
139
|
+
declare const equals: {
|
|
140
|
+
/**
|
|
141
|
+
* Checks if two `Vector2` instances are approximately equal within the
|
|
142
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
143
|
+
*
|
|
144
|
+
* @param a - The first vector.
|
|
145
|
+
* @param b - The second vector.
|
|
146
|
+
* @returns `true` when each pair of components is within tolerance.
|
|
147
|
+
* @since 1.1.0
|
|
148
|
+
*/
|
|
149
|
+
(a: Vector2, b: Vector2): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Checks if two `Vector2` instances are approximately equal within the
|
|
152
|
+
* default absolute tolerance ({@link EPSILON}).
|
|
153
|
+
*
|
|
154
|
+
* @param b - The second vector.
|
|
155
|
+
* @returns A function that takes the first vector and returns the comparison result.
|
|
156
|
+
* @since 1.1.0
|
|
157
|
+
*/
|
|
158
|
+
(b: Vector2): (a: Vector2) => boolean;
|
|
159
|
+
};
|
|
160
|
+
declare const make: {
|
|
161
|
+
/**
|
|
162
|
+
* Creates a new `Vector2` instance.
|
|
163
|
+
*
|
|
164
|
+
* @param xy - The x and y components of the vector.
|
|
165
|
+
* @returns A new `Vector2` instance.
|
|
166
|
+
* @since 1.0.0
|
|
167
|
+
*/
|
|
168
|
+
(xy: number): Vector2;
|
|
169
|
+
/**
|
|
170
|
+
* Creates a new `Vector2` instance.
|
|
171
|
+
*
|
|
172
|
+
* @param x - The x component of the vector.
|
|
173
|
+
* @param y - The y component of the vector.
|
|
174
|
+
* @returns A new `Vector2` instance.
|
|
175
|
+
* @since 1.0.0
|
|
176
|
+
*/
|
|
177
|
+
(x: number, y: number): Vector2;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Transposes a 2-tuple of items into one or more `Vector2`s, one per channel
|
|
181
|
+
* extracted by the projection function. See {@link Vector4.transpose} for the
|
|
182
|
+
* full operation description; this is the 2-component analog.
|
|
183
|
+
*
|
|
184
|
+
* @param inputs - Exactly two items of any type.
|
|
185
|
+
* @param project - A function returning a fixed-arity tuple of numbers — one per output channel.
|
|
186
|
+
* @returns A tuple of `Vector2`s with the same arity as the projection's return tuple.
|
|
187
|
+
* @since 2.1.0
|
|
188
|
+
*/
|
|
189
|
+
declare const transpose: <T, const Channels extends ReadonlyArray<number>>(inputs: readonly [T, T], project: (item: T) => Channels) => { readonly [K in keyof Channels]: Vector2 };
|
|
190
|
+
/**
|
|
191
|
+
* Creates a new `Vector2` instance from polar coordinates.
|
|
192
|
+
*
|
|
193
|
+
* @param r - The radius.
|
|
194
|
+
* @param theta - The angle, in radians.
|
|
195
|
+
* @returns A new `Vector2` instance.
|
|
196
|
+
* @since 1.0.0
|
|
197
|
+
*/
|
|
198
|
+
declare const fromPolar: (r: number, theta: number) => Vector2;
|
|
199
|
+
/**
|
|
200
|
+
* Calculates the magnitude of a `Vector2`.
|
|
201
|
+
*
|
|
202
|
+
* @param vector - The vector to calculate the magnitude of.
|
|
203
|
+
* @returns The magnitude of the vector.
|
|
204
|
+
* @since 1.0.0
|
|
205
|
+
*/
|
|
206
|
+
declare const magnitude: (vector: Vector2) => number;
|
|
207
|
+
/**
|
|
208
|
+
* Normalizes a `Vector2`.
|
|
209
|
+
*
|
|
210
|
+
* @param vector - The vector to normalize.
|
|
211
|
+
* @returns A new `Vector2` instance with the same direction and a magnitude of 1.
|
|
212
|
+
* @since 1.0.0
|
|
213
|
+
*/
|
|
214
|
+
declare const normalize: (vector: Vector2) => Vector2;
|
|
215
|
+
declare const dot: {
|
|
216
|
+
/**
|
|
217
|
+
* Calculates the dot product of two `Vector2` instances.
|
|
218
|
+
*
|
|
219
|
+
* @param a - The first vector.
|
|
220
|
+
* @param b - The second vector.
|
|
221
|
+
* @returns The dot product of the two vectors.
|
|
222
|
+
* @since 1.0.0
|
|
223
|
+
*/
|
|
224
|
+
(a: Vector2, b: Vector2): number;
|
|
225
|
+
/**
|
|
226
|
+
* Calculates the dot product of two `Vector2` instances.
|
|
227
|
+
*
|
|
228
|
+
* @param b - The second vector.
|
|
229
|
+
* @returns A function that takes the first vector and returns the dot product.
|
|
230
|
+
* @since 1.0.0
|
|
231
|
+
*/
|
|
232
|
+
(b: Vector2): (a: Vector2) => number;
|
|
233
|
+
};
|
|
234
|
+
declare const cross: {
|
|
235
|
+
/**
|
|
236
|
+
* Calculates the cross product of two `Vector2` instances.
|
|
237
|
+
*
|
|
238
|
+
* @param a - The first vector.
|
|
239
|
+
* @param b - The second vector.
|
|
240
|
+
* @returns The cross product of the two vectors.
|
|
241
|
+
* @since 1.0.0
|
|
242
|
+
*/
|
|
243
|
+
(a: Vector2, b: Vector2): number;
|
|
244
|
+
/**
|
|
245
|
+
* Calculates the cross product of two `Vector2` instances.
|
|
246
|
+
*
|
|
247
|
+
* @param b - The second vector.
|
|
248
|
+
* @returns A function that takes the first vector and returns the cross product.
|
|
249
|
+
* @since 1.0.0
|
|
250
|
+
*/
|
|
251
|
+
(b: Vector2): (a: Vector2) => number;
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Returns the components of a `Vector2` as an array.
|
|
255
|
+
*
|
|
256
|
+
* @param r - The radius.
|
|
257
|
+
* @param theta - The angle, in radians.
|
|
258
|
+
* @returns A new `Vector2` instance.
|
|
259
|
+
* @since 1.0.0
|
|
260
|
+
*/
|
|
261
|
+
declare const components: (v: Vector2) => [number, number];
|
|
262
|
+
/**
|
|
263
|
+
* Applies the softmax function to a `Vector2`.
|
|
264
|
+
*
|
|
265
|
+
* @param v - The vector to apply the softmax function to.
|
|
266
|
+
* @returns A new `Vector2` instance with the softmax applied.
|
|
267
|
+
* @since 1.0.0
|
|
268
|
+
*/
|
|
269
|
+
declare const softmax: (v: Vector2) => Vector2;
|
|
270
|
+
/**
|
|
271
|
+
* Creates a zero vector.
|
|
272
|
+
*
|
|
273
|
+
* @returns A new `Vector2` instance with both components set to 0.
|
|
274
|
+
* @since 1.0.0
|
|
275
|
+
*/
|
|
276
|
+
declare const zero: Vector2;
|
|
277
|
+
/**
|
|
278
|
+
* Creates a unit vector.
|
|
279
|
+
*
|
|
280
|
+
* @returns A new `Vector2` instance with both components set to 1.
|
|
281
|
+
* @since 1.0.0
|
|
282
|
+
*/
|
|
283
|
+
declare const unit: Vector2;
|
|
284
|
+
declare const add: {
|
|
285
|
+
/**
|
|
286
|
+
* Adds two `Vector2` instances together.
|
|
287
|
+
*
|
|
288
|
+
* @param a - The first vector.
|
|
289
|
+
* @param b - The second vector.
|
|
290
|
+
* @returns A new `Vector2` instance representing the sum of the two vectors.
|
|
291
|
+
* @since 1.0.0
|
|
292
|
+
*/
|
|
293
|
+
(a: Vector2, b: Vector2): Vector2;
|
|
294
|
+
/**
|
|
295
|
+
* Adds two `Vector2` instances together.
|
|
296
|
+
*
|
|
297
|
+
* @param b - The second vector.
|
|
298
|
+
* @returns A function that takes the first vector and returns the sum.
|
|
299
|
+
* @since 1.0.0
|
|
300
|
+
*/
|
|
301
|
+
(b: Vector2): (a: Vector2) => Vector2;
|
|
302
|
+
};
|
|
303
|
+
declare const subtract: {
|
|
304
|
+
/**
|
|
305
|
+
* Subtracts one `Vector2` instance from another.
|
|
306
|
+
*
|
|
307
|
+
* @param a - The first vector.
|
|
308
|
+
* @param b - The second vector.
|
|
309
|
+
* @returns A new `Vector2` instance representing the difference of the two vectors.
|
|
310
|
+
* @since 1.0.0
|
|
311
|
+
*/
|
|
312
|
+
(a: Vector2, b: Vector2): Vector2;
|
|
313
|
+
/**
|
|
314
|
+
* Subtracts one `Vector2` instance from another.
|
|
315
|
+
*
|
|
316
|
+
* @param b - The second vector.
|
|
317
|
+
* @returns A function that takes the first vector and returns the difference.
|
|
318
|
+
* @since 1.0.0
|
|
319
|
+
*/
|
|
320
|
+
(b: Vector2): (a: Vector2) => Vector2;
|
|
321
|
+
};
|
|
322
|
+
declare const hadamard: {
|
|
323
|
+
/**
|
|
324
|
+
* Performs the Hadamard product of two `Vector2` instances.
|
|
325
|
+
*
|
|
326
|
+
* @param a - The first vector.
|
|
327
|
+
* @param b - The second vector.
|
|
328
|
+
* @returns A new `Vector2` instance representing the Hadamard product of the two vectors.
|
|
329
|
+
* @since 1.0.0
|
|
330
|
+
*/
|
|
331
|
+
(a: Vector2, b: Vector2): Vector2;
|
|
332
|
+
/**
|
|
333
|
+
* Performs the Hadamard product of two `Vector2` instances.
|
|
334
|
+
*
|
|
335
|
+
* @param b - The second vector.
|
|
336
|
+
* @returns A function that takes the first vector and returns the Hadamard product.
|
|
337
|
+
* @since 1.0.0
|
|
338
|
+
*/
|
|
339
|
+
(b: Vector2): (a: Vector2) => Vector2;
|
|
340
|
+
};
|
|
341
|
+
declare const scale: {
|
|
342
|
+
/**
|
|
343
|
+
* Scales a `Vector2` by a scalar value.
|
|
344
|
+
*
|
|
345
|
+
* @param s - The scalar value to scale by.
|
|
346
|
+
* @returns A function that takes a vector and returns the scaled vector.
|
|
347
|
+
* @since 1.0.0
|
|
348
|
+
*/
|
|
349
|
+
(s: number): (v: Vector2) => Vector2;
|
|
350
|
+
/**
|
|
351
|
+
* Scales a `Vector2` by a scalar value.
|
|
352
|
+
*
|
|
353
|
+
* @param v - The vector to scale.
|
|
354
|
+
* @param s - The scalar value to scale by.
|
|
355
|
+
* @returns A new `Vector2` instance representing the scaled vector.
|
|
356
|
+
* @since 1.0.0
|
|
357
|
+
*/
|
|
358
|
+
(v: Vector2, s: number): Vector2;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Gets the x component of a `Vector2`.
|
|
362
|
+
*
|
|
363
|
+
* @param v - The vector to get the x component from.
|
|
364
|
+
* @returns The x component of the vector.
|
|
365
|
+
* @since 1.0.0
|
|
366
|
+
*/
|
|
367
|
+
declare const getX: (v: Vector2) => number;
|
|
368
|
+
declare const setX: {
|
|
369
|
+
/**
|
|
370
|
+
* Sets the x component of a `Vector2`.
|
|
371
|
+
*
|
|
372
|
+
* @param v - The vector to set the x component of.
|
|
373
|
+
* @param x - The new x component.
|
|
374
|
+
* @returns A new `Vector2` instance with the updated x component.
|
|
375
|
+
* @since 1.0.0
|
|
376
|
+
*/
|
|
377
|
+
(v: Vector2, x: number): Vector2;
|
|
378
|
+
/**
|
|
379
|
+
* Sets the x component of a `Vector2`.
|
|
380
|
+
*
|
|
381
|
+
* @param x - The new x component.
|
|
382
|
+
* @returns A function that takes a vector and returns the updated vector.
|
|
383
|
+
* @since 1.0.0
|
|
384
|
+
*/
|
|
385
|
+
(x: number): (v: Vector2) => Vector2;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Gets the y component of a `Vector2`.
|
|
389
|
+
*
|
|
390
|
+
* @param v - The vector to get the y component from.
|
|
391
|
+
* @returns The y component of the vector.
|
|
392
|
+
* @since 1.0.0
|
|
393
|
+
*/
|
|
394
|
+
declare const getY: (v: Vector2) => number;
|
|
395
|
+
declare const setY: {
|
|
396
|
+
/**
|
|
397
|
+
* Sets the y component of a `Vector2`.
|
|
398
|
+
*
|
|
399
|
+
* @param v - The vector to set the y component of.
|
|
400
|
+
* @param y - The new y component.
|
|
401
|
+
* @returns A new `Vector2` instance with the updated y component.
|
|
402
|
+
* @since 1.0.0
|
|
403
|
+
*/
|
|
404
|
+
(v: Vector2, y: number): Vector2;
|
|
405
|
+
/**
|
|
406
|
+
* Sets the y component of a `Vector2`.
|
|
407
|
+
*
|
|
408
|
+
* @param y - The new y component.
|
|
409
|
+
* @returns A function that takes a vector and returns the updated vector.
|
|
410
|
+
* @since 1.0.0
|
|
411
|
+
*/
|
|
412
|
+
(y: number): (v: Vector2) => Vector2;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* Gets the radius of a `Vector2`.
|
|
416
|
+
*
|
|
417
|
+
* @param v - The vector to get the radius from.
|
|
418
|
+
* @returns The radius of the vector.
|
|
419
|
+
* @since 1.0.0
|
|
420
|
+
*/
|
|
421
|
+
declare const getR: (v: Vector2) => number;
|
|
422
|
+
declare const setR: {
|
|
423
|
+
/**
|
|
424
|
+
* Sets the radius of a `Vector2`.
|
|
425
|
+
*
|
|
426
|
+
* @param v - The vector to set the radius of.
|
|
427
|
+
* @param r - The new radius.
|
|
428
|
+
* @returns A new `Vector2` instance with the updated radius.
|
|
429
|
+
* @since 1.0.0
|
|
430
|
+
*/
|
|
431
|
+
(v: Vector2, r: number): Vector2;
|
|
432
|
+
/**
|
|
433
|
+
* Sets the radius of a `Vector2`.
|
|
434
|
+
*
|
|
435
|
+
* @param r - The new radius.
|
|
436
|
+
* @returns A function that takes a vector and returns the updated vector.
|
|
437
|
+
* @since 1.0.0
|
|
438
|
+
*/
|
|
439
|
+
(r: number): (v: Vector2) => Vector2;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* Gets the angle of a `Vector2`.
|
|
443
|
+
*
|
|
444
|
+
* @param v - The vector to get the angle from.
|
|
445
|
+
* @returns The angle of the vector in radians.
|
|
446
|
+
* @since 1.0.0
|
|
447
|
+
*/
|
|
448
|
+
declare const getTheta: (v: Vector2) => number;
|
|
449
|
+
declare const setTheta: {
|
|
450
|
+
/**
|
|
451
|
+
* Sets the angle of a `Vector2`.
|
|
452
|
+
*
|
|
453
|
+
* @param v - The vector to set the angle of.
|
|
454
|
+
* @param theta - The new angle, in radians.
|
|
455
|
+
* @returns A new `Vector2` instance with the updated angle.
|
|
456
|
+
* @since 1.0.0
|
|
457
|
+
*/
|
|
458
|
+
(v: Vector2, theta: number): Vector2;
|
|
459
|
+
/**
|
|
460
|
+
* Sets the angle of a `Vector2`.
|
|
461
|
+
*
|
|
462
|
+
* @param theta - The new angle, in radians.
|
|
463
|
+
* @returns A function that takes a vector and returns the updated vector.
|
|
464
|
+
* @since 1.0.0
|
|
465
|
+
*/
|
|
466
|
+
(theta: number): (v: Vector2) => Vector2;
|
|
467
|
+
};
|
|
468
|
+
//#endregion
|
|
469
|
+
export { FourDimensionalComponent as a, ThreeDimensionalComponent as c, TwoDimensionalComponent as d, TwoDimensionalIndex as f, FourDimensional as i, ThreeDimensionalIndex as l, Weighted as n, FourDimensionalIndex as o, vector2_d_exports as r, ThreeDimensional as s, Vector2 as t, TwoDimensional as u };
|
|
470
|
+
//# sourceMappingURL=vector2-DPUY3_eA.d.mts.map
|