@pawells/math-extended 2.0.0 → 3.0.0
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/README.md +15 -21
- package/build/clamp.d.ts +5 -5
- package/build/clamp.js +5 -5
- package/build/core.d.ts +23 -0
- package/build/core.d.ts.map +1 -0
- package/build/core.js +25 -0
- package/build/core.js.map +1 -0
- package/build/index.d.ts +1 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -6
- package/build/index.js.map +1 -1
- package/build/interpolation.d.ts +158 -171
- package/build/interpolation.d.ts.map +1 -1
- package/build/interpolation.js +162 -181
- package/build/interpolation.js.map +1 -1
- package/build/matrices/arithmetic.d.ts +132 -132
- package/build/matrices/arithmetic.d.ts.map +1 -1
- package/build/matrices/arithmetic.js +194 -226
- package/build/matrices/arithmetic.js.map +1 -1
- package/build/matrices/asserts.d.ts +30 -408
- package/build/matrices/asserts.d.ts.map +1 -1
- package/build/matrices/asserts.js +98 -542
- package/build/matrices/asserts.js.map +1 -1
- package/build/matrices/core.d.ts +117 -46
- package/build/matrices/core.d.ts.map +1 -1
- package/build/matrices/core.js +127 -103
- package/build/matrices/core.js.map +1 -1
- package/build/matrices/decompositions.d.ts +95 -96
- package/build/matrices/decompositions.d.ts.map +1 -1
- package/build/matrices/decompositions.js +119 -160
- package/build/matrices/decompositions.js.map +1 -1
- package/build/matrices/index.d.ts +0 -1
- package/build/matrices/index.d.ts.map +1 -1
- package/build/matrices/index.js +0 -3
- package/build/matrices/index.js.map +1 -1
- package/build/matrices/linear-algebra.d.ts +45 -8
- package/build/matrices/linear-algebra.d.ts.map +1 -1
- package/build/matrices/linear-algebra.js +76 -32
- package/build/matrices/linear-algebra.js.map +1 -1
- package/build/matrices/normalization.d.ts +29 -8
- package/build/matrices/normalization.d.ts.map +1 -1
- package/build/matrices/normalization.js +32 -23
- package/build/matrices/normalization.js.map +1 -1
- package/build/matrices/transformations.d.ts +116 -148
- package/build/matrices/transformations.d.ts.map +1 -1
- package/build/matrices/transformations.js +69 -91
- package/build/matrices/transformations.js.map +1 -1
- package/build/matrices/types.d.ts +32 -60
- package/build/matrices/types.d.ts.map +1 -1
- package/build/matrices/types.js +63 -1
- package/build/matrices/types.js.map +1 -1
- package/build/quaternions/asserts.d.ts +29 -38
- package/build/quaternions/asserts.d.ts.map +1 -1
- package/build/quaternions/asserts.js +61 -77
- package/build/quaternions/asserts.js.map +1 -1
- package/build/quaternions/conversions.d.ts +26 -26
- package/build/quaternions/conversions.d.ts.map +1 -1
- package/build/quaternions/conversions.js +24 -24
- package/build/quaternions/core.d.ts +70 -69
- package/build/quaternions/core.d.ts.map +1 -1
- package/build/quaternions/core.js +71 -71
- package/build/quaternions/core.js.map +1 -1
- package/build/quaternions/index.d.ts +0 -1
- package/build/quaternions/index.d.ts.map +1 -1
- package/build/quaternions/index.js +0 -2
- package/build/quaternions/index.js.map +1 -1
- package/build/quaternions/interpolation.d.ts +16 -16
- package/build/quaternions/interpolation.d.ts.map +1 -1
- package/build/quaternions/interpolation.js +21 -21
- package/build/quaternions/interpolation.js.map +1 -1
- package/build/quaternions/predefined.d.ts +10 -10
- package/build/quaternions/predefined.d.ts.map +1 -1
- package/build/quaternions/predefined.js +9 -9
- package/build/quaternions/types.d.ts +23 -12
- package/build/quaternions/types.d.ts.map +1 -1
- package/build/quaternions/types.js +51 -1
- package/build/quaternions/types.js.map +1 -1
- package/build/random.d.ts +66 -20
- package/build/random.d.ts.map +1 -1
- package/build/random.js +73 -20
- package/build/random.js.map +1 -1
- package/build/vectors/asserts.d.ts +50 -220
- package/build/vectors/asserts.d.ts.map +1 -1
- package/build/vectors/asserts.js +141 -327
- package/build/vectors/asserts.js.map +1 -1
- package/build/vectors/core.d.ts +182 -229
- package/build/vectors/core.d.ts.map +1 -1
- package/build/vectors/core.js +234 -288
- package/build/vectors/core.js.map +1 -1
- package/build/vectors/index.d.ts +0 -1
- package/build/vectors/index.d.ts.map +1 -1
- package/build/vectors/index.js +0 -2
- package/build/vectors/index.js.map +1 -1
- package/build/vectors/interpolation.d.ts +40 -40
- package/build/vectors/interpolation.d.ts.map +1 -1
- package/build/vectors/interpolation.js +75 -86
- package/build/vectors/interpolation.js.map +1 -1
- package/build/vectors/predefined.d.ts +31 -7
- package/build/vectors/predefined.d.ts.map +1 -1
- package/build/vectors/predefined.js +30 -6
- package/build/vectors/predefined.js.map +1 -1
- package/build/vectors/types.d.ts +26 -4
- package/build/vectors/types.d.ts.map +1 -1
- package/build/vectors/types.js +50 -1
- package/build/vectors/types.js.map +1 -1
- package/package.json +3 -2
- package/build/matrices/_exports.d.ts +0 -13
- package/build/matrices/_exports.d.ts.map +0 -1
- package/build/matrices/_exports.js +0 -13
- package/build/matrices/_exports.js.map +0 -1
- package/build/quaternions/_exports.d.ts +0 -11
- package/build/quaternions/_exports.d.ts.map +0 -1
- package/build/quaternions/_exports.js +0 -11
- package/build/quaternions/_exports.js.map +0 -1
- package/build/vectors/_exports.d.ts +0 -10
- package/build/vectors/_exports.d.ts.map +0 -1
- package/build/vectors/_exports.js +0 -10
- package/build/vectors/_exports.js.map +0 -1
package/build/interpolation.d.ts
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* @returns `a + (b - a) * t`
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
* ```typescript
|
|
13
|
+
* LinearInterpolation(0, 100, 0.5) // 50
|
|
14
|
+
* LinearInterpolation(0, 100, 0) // 0
|
|
15
|
+
* LinearInterpolation(0, 100, 1) // 100
|
|
16
|
+
* LinearInterpolation(0, 100, 1.5) // 150 (extrapolation)
|
|
17
|
+
* ```
|
|
18
18
|
*/
|
|
19
19
|
export declare function LinearInterpolation(a: number, b: number, t: number): number;
|
|
20
20
|
/**
|
|
@@ -27,11 +27,11 @@ export declare function LinearInterpolation(a: number, b: number, t: number): nu
|
|
|
27
27
|
* @returns Interpolated value using cubic smooth-step curve
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
* ```typescript
|
|
31
|
+
* SmoothStep(0, 10, 0) // 0
|
|
32
|
+
* SmoothStep(0, 10, 1) // 10
|
|
33
|
+
* SmoothStep(0, 10, 0.25) // 1.5625 (slower start than LinearInterpolation's 2.5)
|
|
34
|
+
* ```
|
|
35
35
|
*/
|
|
36
36
|
export declare function SmoothStep(a: number, b: number, t: number): number;
|
|
37
37
|
/**
|
|
@@ -45,11 +45,11 @@ export declare function SmoothStep(a: number, b: number, t: number): number;
|
|
|
45
45
|
* @returns Interpolated value using quintic smoother-step curve
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
* ```typescript
|
|
49
|
+
* SmootherStep(0, 10, 0) // 0
|
|
50
|
+
* SmootherStep(0, 10, 1) // 10
|
|
51
|
+
* SmootherStep(0, 10, 0.25) // ~1.04 (smoother start than SmoothStep)
|
|
52
|
+
* ```
|
|
53
53
|
*/
|
|
54
54
|
export declare function SmootherStep(a: number, b: number, t: number): number;
|
|
55
55
|
/**
|
|
@@ -62,11 +62,11 @@ export declare function SmootherStep(a: number, b: number, t: number): number;
|
|
|
62
62
|
* @returns Interpolated value with quadratic acceleration from start
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
* ```typescript
|
|
66
|
+
* QuadraticEaseIn(0, 10, 0) // 0
|
|
67
|
+
* QuadraticEaseIn(0, 10, 1) // 10
|
|
68
|
+
* QuadraticEaseIn(0, 10, 0.5) // 2.5 (only 25% progress at the midpoint)
|
|
69
|
+
* ```
|
|
70
70
|
*/
|
|
71
71
|
export declare function QuadraticEaseIn(a: number, b: number, t: number): number;
|
|
72
72
|
/**
|
|
@@ -79,11 +79,11 @@ export declare function QuadraticEaseIn(a: number, b: number, t: number): number
|
|
|
79
79
|
* @returns Interpolated value with quadratic deceleration toward end
|
|
80
80
|
*
|
|
81
81
|
* @example
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
* ```typescript
|
|
83
|
+
* QuadraticEaseOut(0, 10, 0) // 0
|
|
84
|
+
* QuadraticEaseOut(0, 10, 1) // 10
|
|
85
|
+
* QuadraticEaseOut(0, 10, 0.5) // 7.5 (already 75% progress at the midpoint)
|
|
86
|
+
* ```
|
|
87
87
|
*/
|
|
88
88
|
export declare function QuadraticEaseOut(a: number, b: number, t: number): number;
|
|
89
89
|
/**
|
|
@@ -96,11 +96,11 @@ export declare function QuadraticEaseOut(a: number, b: number, t: number): numbe
|
|
|
96
96
|
* @returns Interpolated value with cubic acceleration from start
|
|
97
97
|
*
|
|
98
98
|
* @example
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
* ```typescript
|
|
100
|
+
* CubicEaseIn(0, 10, 0) // 0
|
|
101
|
+
* CubicEaseIn(0, 10, 1) // 10
|
|
102
|
+
* CubicEaseIn(0, 10, 0.5) // 1.25 (only 12.5% progress at the midpoint)
|
|
103
|
+
* ```
|
|
104
104
|
*/
|
|
105
105
|
export declare function CubicEaseIn(a: number, b: number, t: number): number;
|
|
106
106
|
/**
|
|
@@ -113,11 +113,11 @@ export declare function CubicEaseIn(a: number, b: number, t: number): number;
|
|
|
113
113
|
* @returns Interpolated value with cubic deceleration toward end
|
|
114
114
|
*
|
|
115
115
|
* @example
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
* ```typescript
|
|
117
|
+
* CubicEaseOut(0, 10, 0) // 0
|
|
118
|
+
* CubicEaseOut(0, 10, 1) // 10
|
|
119
|
+
* CubicEaseOut(0, 10, 0.5) // 8.75 (already 87.5% progress at the midpoint)
|
|
120
|
+
* ```
|
|
121
121
|
*/
|
|
122
122
|
export declare function CubicEaseOut(a: number, b: number, t: number): number;
|
|
123
123
|
/**
|
|
@@ -130,11 +130,11 @@ export declare function CubicEaseOut(a: number, b: number, t: number): number;
|
|
|
130
130
|
* @returns Interpolated value using cosine-based easing curve
|
|
131
131
|
*
|
|
132
132
|
* @example
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
* ```typescript
|
|
134
|
+
* CosineInterpolation(0, 10, 0) // 0
|
|
135
|
+
* CosineInterpolation(0, 10, 1) // 10
|
|
136
|
+
* CosineInterpolation(0, 10, 0.5) // 5 (same as LERP at midpoint; smooth near endpoints)
|
|
137
|
+
* ```
|
|
138
138
|
*/
|
|
139
139
|
export declare function CosineInterpolation(a: number, b: number, t: number): number;
|
|
140
140
|
/**
|
|
@@ -147,11 +147,11 @@ export declare function CosineInterpolation(a: number, b: number, t: number): nu
|
|
|
147
147
|
* @returns Interpolated value with sine-based acceleration from start
|
|
148
148
|
*
|
|
149
149
|
* @example
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
* ```typescript
|
|
151
|
+
* SineEaseIn(0, 10, 0) // 0
|
|
152
|
+
* SineEaseIn(0, 10, 1) // 10
|
|
153
|
+
* SineEaseIn(0, 10, 0.5) // ~2.93 (slower than LinearInterpolation's 5 at midpoint)
|
|
154
|
+
* ```
|
|
155
155
|
*/
|
|
156
156
|
export declare function SineEaseIn(a: number, b: number, t: number): number;
|
|
157
157
|
/**
|
|
@@ -164,11 +164,11 @@ export declare function SineEaseIn(a: number, b: number, t: number): number;
|
|
|
164
164
|
* @returns Interpolated value with sine-based deceleration toward end
|
|
165
165
|
*
|
|
166
166
|
* @example
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
* ```typescript
|
|
168
|
+
* SineEaseOut(0, 10, 0) // 0
|
|
169
|
+
* SineEaseOut(0, 10, 1) // 10
|
|
170
|
+
* SineEaseOut(0, 10, 0.5) // ~7.07 (faster than LinearInterpolation's 5 at midpoint)
|
|
171
|
+
* ```
|
|
172
172
|
*/
|
|
173
173
|
export declare function SineEaseOut(a: number, b: number, t: number): number;
|
|
174
174
|
/**
|
|
@@ -181,11 +181,11 @@ export declare function SineEaseOut(a: number, b: number, t: number): number;
|
|
|
181
181
|
* @returns Interpolated value with exponential acceleration from start
|
|
182
182
|
*
|
|
183
183
|
* @example
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
* ```typescript
|
|
185
|
+
* ExponentialEaseIn(0, 10, 0) // 0
|
|
186
|
+
* ExponentialEaseIn(0, 10, 1) // 10
|
|
187
|
+
* ExponentialEaseIn(0, 10, 0.5) // ~0.31 (barely moved at midpoint)
|
|
188
|
+
* ```
|
|
189
189
|
*/
|
|
190
190
|
export declare function ExponentialEaseIn(a: number, b: number, t: number): number;
|
|
191
191
|
/**
|
|
@@ -198,11 +198,11 @@ export declare function ExponentialEaseIn(a: number, b: number, t: number): numb
|
|
|
198
198
|
* @returns Interpolated value with exponential deceleration toward end
|
|
199
199
|
*
|
|
200
200
|
* @example
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
* ```typescript
|
|
202
|
+
* ExponentialEaseOut(0, 10, 0) // 0
|
|
203
|
+
* ExponentialEaseOut(0, 10, 1) // 10
|
|
204
|
+
* ExponentialEaseOut(0, 10, 0.5) // ~9.69 (nearly done at midpoint)
|
|
205
|
+
* ```
|
|
206
206
|
*/
|
|
207
207
|
export declare function ExponentialEaseOut(a: number, b: number, t: number): number;
|
|
208
208
|
/**
|
|
@@ -215,11 +215,11 @@ export declare function ExponentialEaseOut(a: number, b: number, t: number): num
|
|
|
215
215
|
* @returns Interpolated value with elastic overshoot effect toward end
|
|
216
216
|
*
|
|
217
217
|
* @example
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
* ```typescript
|
|
219
|
+
* ElasticEaseOut(0, 10, 0) // 0
|
|
220
|
+
* ElasticEaseOut(0, 10, 1) // 10
|
|
221
|
+
* ElasticEaseOut(0, 10, 0.8) // ~10.86 (overshoots target before settling)
|
|
222
|
+
* ```
|
|
223
223
|
*/
|
|
224
224
|
export declare function ElasticEaseOut(a: number, b: number, t: number): number;
|
|
225
225
|
/**
|
|
@@ -232,11 +232,11 @@ export declare function ElasticEaseOut(a: number, b: number, t: number): number;
|
|
|
232
232
|
* @returns Interpolated value with back overshoot effect toward end
|
|
233
233
|
*
|
|
234
234
|
* @example
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
235
|
+
* ```typescript
|
|
236
|
+
* BackEaseOut(0, 10, 0) // 0
|
|
237
|
+
* BackEaseOut(0, 10, 1) // 10
|
|
238
|
+
* BackEaseOut(0, 10, 0.75) // ~10.88 (overshoots before settling)
|
|
239
|
+
* ```
|
|
240
240
|
*/
|
|
241
241
|
export declare function BackEaseOut(a: number, b: number, t: number): number;
|
|
242
242
|
/**
|
|
@@ -249,11 +249,11 @@ export declare function BackEaseOut(a: number, b: number, t: number): number;
|
|
|
249
249
|
* @returns Interpolated value with bouncing effect toward end
|
|
250
250
|
*
|
|
251
251
|
* @example
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
* ```typescript
|
|
253
|
+
* BounceEaseOut(0, 10, 0) // 0
|
|
254
|
+
* BounceEaseOut(0, 10, 1) // 10
|
|
255
|
+
* BounceEaseOut(0, 10, 0.5) // ~7.65 (mid-bounce)
|
|
256
|
+
* ```
|
|
257
257
|
*/
|
|
258
258
|
export declare function BounceEaseOut(a: number, b: number, t: number): number;
|
|
259
259
|
/**
|
|
@@ -268,11 +268,11 @@ export declare function BounceEaseOut(a: number, b: number, t: number): number;
|
|
|
268
268
|
* @returns Smoothly interpolated value along the Catmull-Rom spline
|
|
269
269
|
*
|
|
270
270
|
* @example
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
* ```typescript
|
|
272
|
+
* CatmullRomInterpolation(0, 5, 10, 15, 0) // 5 (at p1)
|
|
273
|
+
* CatmullRomInterpolation(0, 5, 10, 15, 1) // 10 (at p2)
|
|
274
|
+
* CatmullRomInterpolation(0, 5, 10, 15, 0.5) // 7.5
|
|
275
|
+
* ```
|
|
276
276
|
*/
|
|
277
277
|
export declare function CatmullRomInterpolation(p0: number, p1: number, p2: number, p3: number, t: number): number;
|
|
278
278
|
/**
|
|
@@ -287,11 +287,11 @@ export declare function CatmullRomInterpolation(p0: number, p1: number, p2: numb
|
|
|
287
287
|
* @returns Interpolated value along the Hermite spline
|
|
288
288
|
*
|
|
289
289
|
* @example
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
290
|
+
* ```typescript
|
|
291
|
+
* HermiteInterpolation(0, 10, 0, 0, 0) // 0 (at start)
|
|
292
|
+
* HermiteInterpolation(0, 10, 0, 0, 1) // 10 (at end)
|
|
293
|
+
* HermiteInterpolation(0, 10, 0, 0, 0.5) // 5 (flat tangents → same as LERP at midpoint)
|
|
294
|
+
* ```
|
|
295
295
|
*/
|
|
296
296
|
export declare function HermiteInterpolation(p0: number, p1: number, t0: number, t1: number, t: number): number;
|
|
297
297
|
/**
|
|
@@ -304,11 +304,11 @@ export declare function HermiteInterpolation(p0: number, p1: number, t0: number,
|
|
|
304
304
|
* @returns Interpolated value with circular acceleration from start
|
|
305
305
|
*
|
|
306
306
|
* @example
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
* ```typescript
|
|
308
|
+
* CircularEaseIn(0, 10, 0) // 0
|
|
309
|
+
* CircularEaseIn(0, 10, 1) // 10
|
|
310
|
+
* CircularEaseIn(0, 10, 0.5) // ~1.34 (very slow start along circular arc)
|
|
311
|
+
* ```
|
|
312
312
|
*/
|
|
313
313
|
export declare function CircularEaseIn(a: number, b: number, t: number): number;
|
|
314
314
|
/**
|
|
@@ -321,11 +321,11 @@ export declare function CircularEaseIn(a: number, b: number, t: number): number;
|
|
|
321
321
|
* @returns Interpolated value with circular deceleration toward end
|
|
322
322
|
*
|
|
323
323
|
* @example
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
324
|
+
* ```typescript
|
|
325
|
+
* CircularEaseOut(0, 10, 0) // 0
|
|
326
|
+
* CircularEaseOut(0, 10, 1) // 10
|
|
327
|
+
* CircularEaseOut(0, 10, 0.5) // ~8.66 (very fast start along circular arc)
|
|
328
|
+
* ```
|
|
329
329
|
*/
|
|
330
330
|
export declare function CircularEaseOut(a: number, b: number, t: number): number;
|
|
331
331
|
/**
|
|
@@ -338,12 +338,12 @@ export declare function CircularEaseOut(a: number, b: number, t: number): number
|
|
|
338
338
|
* @returns Interpolated value with quadratic symmetric easing
|
|
339
339
|
*
|
|
340
340
|
* @example
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
341
|
+
* ```typescript
|
|
342
|
+
* QuadraticEaseInOut(0, 10, 0) // 0
|
|
343
|
+
* QuadraticEaseInOut(0, 10, 1) // 10
|
|
344
|
+
* QuadraticEaseInOut(0, 10, 0.25) // 1.25 (slow start)
|
|
345
|
+
* QuadraticEaseInOut(0, 10, 0.75) // 8.75 (slow end)
|
|
346
|
+
* ```
|
|
347
347
|
*/
|
|
348
348
|
export declare function QuadraticEaseInOut(a: number, b: number, t: number): number;
|
|
349
349
|
/**
|
|
@@ -356,12 +356,12 @@ export declare function QuadraticEaseInOut(a: number, b: number, t: number): num
|
|
|
356
356
|
* @returns Interpolated value with cubic symmetric easing
|
|
357
357
|
*
|
|
358
358
|
* @example
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
359
|
+
* ```typescript
|
|
360
|
+
* CubicEaseInOut(0, 10, 0) // 0
|
|
361
|
+
* CubicEaseInOut(0, 10, 1) // 10
|
|
362
|
+
* CubicEaseInOut(0, 10, 0.25) // 0.625 (very slow start)
|
|
363
|
+
* CubicEaseInOut(0, 10, 0.75) // 9.375 (very slow end)
|
|
364
|
+
* ```
|
|
365
365
|
*/
|
|
366
366
|
export declare function CubicEaseInOut(a: number, b: number, t: number): number;
|
|
367
367
|
/**
|
|
@@ -374,11 +374,11 @@ export declare function CubicEaseInOut(a: number, b: number, t: number): number;
|
|
|
374
374
|
* @returns Interpolated value with sine-based symmetric easing
|
|
375
375
|
*
|
|
376
376
|
* @example
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
377
|
+
* ```typescript
|
|
378
|
+
* SineEaseInOut(0, 10, 0) // 0
|
|
379
|
+
* SineEaseInOut(0, 10, 1) // 10
|
|
380
|
+
* SineEaseInOut(0, 10, 0.5) // 5 (symmetric midpoint)
|
|
381
|
+
* ```
|
|
382
382
|
*/
|
|
383
383
|
export declare function SineEaseInOut(a: number, b: number, t: number): number;
|
|
384
384
|
/**
|
|
@@ -391,11 +391,11 @@ export declare function SineEaseInOut(a: number, b: number, t: number): number;
|
|
|
391
391
|
* @returns Interpolated value with exponential symmetric easing
|
|
392
392
|
*
|
|
393
393
|
* @example
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
394
|
+
* ```typescript
|
|
395
|
+
* ExponentialEaseInOut(0, 10, 0) // 0
|
|
396
|
+
* ExponentialEaseInOut(0, 10, 1) // 10
|
|
397
|
+
* ExponentialEaseInOut(0, 10, 0.25) // ~0.16 (barely moving in the first quarter)
|
|
398
|
+
* ```
|
|
399
399
|
*/
|
|
400
400
|
export declare function ExponentialEaseInOut(a: number, b: number, t: number): number;
|
|
401
401
|
/**
|
|
@@ -408,11 +408,11 @@ export declare function ExponentialEaseInOut(a: number, b: number, t: number): n
|
|
|
408
408
|
* @returns Interpolated value with circular symmetric easing
|
|
409
409
|
*
|
|
410
410
|
* @example
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
411
|
+
* ```typescript
|
|
412
|
+
* CircularEaseInOut(0, 10, 0) // 0
|
|
413
|
+
* CircularEaseInOut(0, 10, 1) // 10
|
|
414
|
+
* CircularEaseInOut(0, 10, 0.25) // ~0.67 (very slow circular start)
|
|
415
|
+
* ```
|
|
416
416
|
*/
|
|
417
417
|
export declare function CircularEaseInOut(a: number, b: number, t: number): number;
|
|
418
418
|
/**
|
|
@@ -425,11 +425,11 @@ export declare function CircularEaseInOut(a: number, b: number, t: number): numb
|
|
|
425
425
|
* @returns Interpolated value with elastic spring acceleration from start
|
|
426
426
|
*
|
|
427
427
|
* @example
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
428
|
+
* ```typescript
|
|
429
|
+
* ElasticEaseIn(0, 10, 0) // 0
|
|
430
|
+
* ElasticEaseIn(0, 10, 1) // 10
|
|
431
|
+
* ElasticEaseIn(0, 10, 0.5) // ~-0.16 (backward oscillation at midpoint before launching)
|
|
432
|
+
* ```
|
|
433
433
|
*/
|
|
434
434
|
export declare function ElasticEaseIn(a: number, b: number, t: number): number;
|
|
435
435
|
/**
|
|
@@ -442,11 +442,11 @@ export declare function ElasticEaseIn(a: number, b: number, t: number): number;
|
|
|
442
442
|
* @returns Interpolated value with elastic oscillation at both ends
|
|
443
443
|
*
|
|
444
444
|
* @example
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
445
|
+
* ```typescript
|
|
446
|
+
* ElasticEaseInOut(0, 10, 0) // 0
|
|
447
|
+
* ElasticEaseInOut(0, 10, 1) // 10
|
|
448
|
+
* ElasticEaseInOut(0, 10, 0.4) // ~-1.17 (backward oscillation before midpoint)
|
|
449
|
+
* ```
|
|
450
450
|
*/
|
|
451
451
|
export declare function ElasticEaseInOut(a: number, b: number, t: number): number;
|
|
452
452
|
/**
|
|
@@ -459,11 +459,11 @@ export declare function ElasticEaseInOut(a: number, b: number, t: number): numbe
|
|
|
459
459
|
* @returns Interpolated value with back overshoot at start
|
|
460
460
|
*
|
|
461
461
|
* @example
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
462
|
+
* ```typescript
|
|
463
|
+
* BackEaseIn(0, 10, 0) // 0
|
|
464
|
+
* BackEaseIn(0, 10, 1) // 10
|
|
465
|
+
* BackEaseIn(0, 10, 0.25) // ~-0.64 (dips below start before accelerating forward)
|
|
466
|
+
* ```
|
|
467
467
|
*/
|
|
468
468
|
export declare function BackEaseIn(a: number, b: number, t: number): number;
|
|
469
469
|
/**
|
|
@@ -476,11 +476,11 @@ export declare function BackEaseIn(a: number, b: number, t: number): number;
|
|
|
476
476
|
* @returns Interpolated value with back overshoot at both start and end
|
|
477
477
|
*
|
|
478
478
|
* @example
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
479
|
+
* ```typescript
|
|
480
|
+
* BackEaseInOut(0, 10, 0) // 0
|
|
481
|
+
* BackEaseInOut(0, 10, 1) // 10
|
|
482
|
+
* BackEaseInOut(0, 10, 0.25) // ~-1.00 (dips backward at start)
|
|
483
|
+
* ```
|
|
484
484
|
*/
|
|
485
485
|
export declare function BackEaseInOut(a: number, b: number, t: number): number;
|
|
486
486
|
/**
|
|
@@ -493,11 +493,11 @@ export declare function BackEaseInOut(a: number, b: number, t: number): number;
|
|
|
493
493
|
* @returns Interpolated value with bounce effect at start
|
|
494
494
|
*
|
|
495
495
|
* @example
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
496
|
+
* ```typescript
|
|
497
|
+
* BounceEaseIn(0, 10, 0) // 0
|
|
498
|
+
* BounceEaseIn(0, 10, 1) // 10
|
|
499
|
+
* BounceEaseIn(0, 10, 0.5) // ~2.34 (still bouncing at midpoint)
|
|
500
|
+
* ```
|
|
501
501
|
*/
|
|
502
502
|
export declare function BounceEaseIn(a: number, b: number, t: number): number;
|
|
503
503
|
/**
|
|
@@ -510,11 +510,11 @@ export declare function BounceEaseIn(a: number, b: number, t: number): number;
|
|
|
510
510
|
* @returns Interpolated value with bounce effect at both start and end
|
|
511
511
|
*
|
|
512
512
|
* @example
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
513
|
+
* ```typescript
|
|
514
|
+
* BounceEaseInOut(0, 10, 0) // 0
|
|
515
|
+
* BounceEaseInOut(0, 10, 1) // 10
|
|
516
|
+
* BounceEaseInOut(0, 10, 0.25) // ~1.17 (bouncing at start quarter)
|
|
517
|
+
* ```
|
|
518
518
|
*/
|
|
519
519
|
export declare function BounceEaseInOut(a: number, b: number, t: number): number;
|
|
520
520
|
/**
|
|
@@ -529,24 +529,11 @@ export declare function BounceEaseInOut(a: number, b: number, t: number): number
|
|
|
529
529
|
* @returns Either `a` or `b` depending on `t` relative to `threshold`
|
|
530
530
|
*
|
|
531
531
|
* @example
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
532
|
+
* ```typescript
|
|
533
|
+
* StepInterpolation(0, 10, 0.3) // 0 (below default threshold of 0.5)
|
|
534
|
+
* StepInterpolation(0, 10, 0.7) // 10 (at or above default threshold of 0.5)
|
|
535
|
+
* StepInterpolation(0, 10, 0.3, 0.25) // 10 (above custom threshold of 0.25)
|
|
536
|
+
* ```
|
|
537
537
|
*/
|
|
538
538
|
export declare function StepInterpolation(a: number, b: number, t: number, threshold?: number): number;
|
|
539
|
-
/**
|
|
540
|
-
* Spherical linear interpolation for scalar values.
|
|
541
|
-
* For scalar inputs, this is mathematically equivalent to {@link LinearInterpolation}.
|
|
542
|
-
* For true spherical rotation interpolation, use `QuaternionSLERP` from the quaternions module.
|
|
543
|
-
*
|
|
544
|
-
* @param a - Start value (result when t = 0)
|
|
545
|
-
* @param b - End value (result when t = 1)
|
|
546
|
-
* @param t - Interpolation parameter — unclamped, allowing extrapolation
|
|
547
|
-
* @returns Linearly interpolated value (identical to `LinearInterpolation(a, b, t)`)
|
|
548
|
-
*
|
|
549
|
-
* @deprecated This function is identical to LinearInterpolation and is not a true spherical interpolation. For quaternion spherical interpolation, use QuaternionSLERP from the quaternions module.
|
|
550
|
-
*/
|
|
551
|
-
export declare function SphericalLinearInterpolation(a: number, b: number, t: number): number;
|
|
552
539
|
//# sourceMappingURL=interpolation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../src/interpolation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../src/interpolation.ts"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,C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