@thi.ng/math 5.10.2 → 5.10.3
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/CHANGELOG.md +1 -1
- package/crossing.d.ts +2 -2
- package/mix.d.ts +28 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/crossing.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type Crossing } from "./api.js";
|
|
|
4
4
|
* Returns true if line A rises up over B.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
|
-
* ```
|
|
7
|
+
* ```text
|
|
8
8
|
* b1 a2
|
|
9
9
|
* \/
|
|
10
10
|
* /\
|
|
@@ -21,7 +21,7 @@ export declare const isCrossOver: FnU4<number, boolean>;
|
|
|
21
21
|
* Returns true if line A rises up over B.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
|
-
* ```
|
|
24
|
+
* ```text
|
|
25
25
|
* a1 b2
|
|
26
26
|
* \/
|
|
27
27
|
* /\
|
package/mix.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const mix: FnN3;
|
|
|
11
11
|
* Bilinear interpolation of given values (`a`,`b`,`c`,`d`).
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* ```
|
|
14
|
+
* ```text
|
|
15
15
|
* c d
|
|
16
16
|
* +----+
|
|
17
17
|
* | |
|
|
@@ -171,6 +171,27 @@ export declare const tangentDiff3: (prev: number, curr: number, next: number, ta
|
|
|
171
171
|
* Returns function which takes normalized time (in [0,1] range) as single arg
|
|
172
172
|
* and returns interpolated value.
|
|
173
173
|
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { easeInOut2, tween } from "@thi.ng/math";
|
|
177
|
+
*
|
|
178
|
+
* // create tweening function
|
|
179
|
+
* const anim = tween(easeInOut2, 100, 200);
|
|
180
|
+
*
|
|
181
|
+
* for(let i=0; i<=10; i++) console.log(anim(i/10));
|
|
182
|
+
* // 100
|
|
183
|
+
* // 102
|
|
184
|
+
* // 108
|
|
185
|
+
* // 118
|
|
186
|
+
* // 132
|
|
187
|
+
* // 150
|
|
188
|
+
* // 168
|
|
189
|
+
* // 182
|
|
190
|
+
* // 192
|
|
191
|
+
* // 198
|
|
192
|
+
* // 200
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
174
195
|
* @param f -
|
|
175
196
|
* @param from -
|
|
176
197
|
* @param to -
|
|
@@ -204,14 +225,18 @@ export declare const invCircular: FnN;
|
|
|
204
225
|
* positive the lens has dilating characteristics and will spread values near
|
|
205
226
|
* `pos` towards the edges.
|
|
206
227
|
*
|
|
207
|
-
* Also see {@link schlick} for an alternative approach
|
|
228
|
+
* Also see {@link schlick} for an alternative approach and {@link tween} for
|
|
229
|
+
* reference to below example.
|
|
208
230
|
*
|
|
209
231
|
* @example
|
|
210
232
|
* ```ts
|
|
233
|
+
* import { mix, lens, tween } from "@thi.ng/math";
|
|
234
|
+
* import { partial } from "@thi.ng/compose";
|
|
235
|
+
*
|
|
211
236
|
* // interpolated position in [100..400] interval for given `t`
|
|
212
237
|
* y = mix(100, 400, lens(0.5, 1, t));
|
|
213
238
|
*
|
|
214
|
-
* // or
|
|
239
|
+
* // or compose tween function via `tween()` & `partial()`
|
|
215
240
|
* f = tween(partial(lens, 0.5, 1), 100, 400);
|
|
216
241
|
*
|
|
217
242
|
* f(t)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/math",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.3",
|
|
4
4
|
"description": "Assorted common math functions & utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"test": "bun test"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@thi.ng/api": "^8.9.
|
|
41
|
+
"@thi.ng/api": "^8.9.26"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"thi.ng": {
|
|
143
143
|
"year": 2013
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
|
|
146
146
|
}
|