@thi.ng/math 5.4.7 → 5.4.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.
- package/CHANGELOG.md +1 -1
- package/mix.d.ts +11 -0
- package/mix.js +11 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/mix.d.ts
CHANGED
|
@@ -224,6 +224,17 @@ export declare const invCircular: FnN;
|
|
|
224
224
|
export declare const lens: FnN3;
|
|
225
225
|
export declare const cosine: FnN;
|
|
226
226
|
export declare const decimated: FnN2;
|
|
227
|
+
/**
|
|
228
|
+
* Spring oscillator with damping.
|
|
229
|
+
*
|
|
230
|
+
* @remarks
|
|
231
|
+
* Interactive graph:
|
|
232
|
+
* https://www.desmos.com/calculator/tywbpw8pck
|
|
233
|
+
*
|
|
234
|
+
* @param k
|
|
235
|
+
* @param amp
|
|
236
|
+
* @param t
|
|
237
|
+
*/
|
|
227
238
|
export declare const bounce: FnN3;
|
|
228
239
|
/**
|
|
229
240
|
* Exponential easing.
|
package/mix.js
CHANGED
|
@@ -265,6 +265,17 @@ export const lens = (pos, strength, t) => {
|
|
|
265
265
|
};
|
|
266
266
|
export const cosine = (t) => 1 - (Math.cos(t * PI) * 0.5 + 0.5);
|
|
267
267
|
export const decimated = (n, t) => Math.floor(t * n) / n;
|
|
268
|
+
/**
|
|
269
|
+
* Spring oscillator with damping.
|
|
270
|
+
*
|
|
271
|
+
* @remarks
|
|
272
|
+
* Interactive graph:
|
|
273
|
+
* https://www.desmos.com/calculator/tywbpw8pck
|
|
274
|
+
*
|
|
275
|
+
* @param k
|
|
276
|
+
* @param amp
|
|
277
|
+
* @param t
|
|
278
|
+
*/
|
|
268
279
|
export const bounce = (k, amp, t) => {
|
|
269
280
|
const tk = t * k;
|
|
270
281
|
return 1 - ((amp * Math.sin(tk)) / tk) * Math.cos(t * HALF_PI);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/math",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.9",
|
|
4
4
|
"description": "Assorted common math functions & utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"test": "testament test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@thi.ng/api": "^8.
|
|
40
|
+
"@thi.ng/api": "^8.8.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@microsoft/api-extractor": "^7.34.4",
|
|
@@ -138,5 +138,5 @@
|
|
|
138
138
|
"thi.ng": {
|
|
139
139
|
"year": 2013
|
|
140
140
|
},
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "ca22f02a137c0a4e3a38ef81e82e2bc7e3c43849\n"
|
|
142
142
|
}
|