@thi.ng/math 5.10.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-02-19T16:07:07Z
3
+ - **Last updated**: 2024-02-25T14:07:53Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
19
19
 
20
20
  > [!NOTE]
21
- > This is one of 189 standalone projects, maintained as part
21
+ > This is one of 190 standalone projects, maintained as part
22
22
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
23
23
  > and anti-framework.
24
24
  >
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
- * ```ts
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
- * ```ts
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
- * ```ts
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 build tween function via `tween()`
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.1",
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.24"
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": "2724c87ca41810f2112f9d8c3d6b90dfaeea876b\n"
145
+ "gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
146
146
  }