@thi.ng/math 5.11.6 → 5.11.7
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/package.json +4 -4
- package/solve.d.ts +10 -6
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/math",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.7",
|
|
4
4
|
"description": "Assorted common math functions & utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"math",
|
|
59
59
|
"prime",
|
|
60
60
|
"quadratic",
|
|
61
|
-
"
|
|
61
|
+
"smoothmax",
|
|
62
|
+
"smoothstep",
|
|
62
63
|
"solver",
|
|
63
|
-
"t-norm",
|
|
64
64
|
"trigonometry",
|
|
65
65
|
"typescript"
|
|
66
66
|
],
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"thi.ng": {
|
|
143
143
|
"year": 2013
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "e914ebbd81c56783c39cf746548c547cbacadc96\n"
|
|
146
146
|
}
|
package/solve.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { FnN2, NumericArray } from "@thi.ng/api";
|
|
2
2
|
/**
|
|
3
3
|
* Produces a new function which computes derivative of the given single-arg
|
|
4
|
-
* function.
|
|
4
|
+
* function.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The extra optional arg `eps` is used to define the step width for
|
|
5
8
|
* computing derived values:
|
|
6
9
|
*
|
|
7
10
|
* `f'(x) = (f(x + eps) - f(x)) / eps`
|
|
@@ -17,9 +20,7 @@ import type { FnN2, NumericArray } from "@thi.ng/api";
|
|
|
17
20
|
*/
|
|
18
21
|
export declare const derivative: (f: (x: number) => number, eps?: number) => (x: number) => number;
|
|
19
22
|
/**
|
|
20
|
-
* Computes solution for linear equation: `ax + b = 0`.
|
|
21
|
-
*
|
|
22
|
-
* Note: Returns 0 iff `a == 0`
|
|
23
|
+
* Computes solution for linear equation: `ax + b = 0`. Returns 0 iff `a == 0`
|
|
23
24
|
*
|
|
24
25
|
* @param a - slope
|
|
25
26
|
* @param b - constant offset
|
|
@@ -27,8 +28,11 @@ export declare const derivative: (f: (x: number) => number, eps?: number) => (x:
|
|
|
27
28
|
export declare const solveLinear: FnN2;
|
|
28
29
|
/**
|
|
29
30
|
* Computes solutions for quadratic equation: `ax^2 + bx + c = 0`. Returns array
|
|
30
|
-
* of real solutions.
|
|
31
|
-
*
|
|
31
|
+
* of real solutions.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* `a` MUST NOT be zero. If the quadratic term is missing, use
|
|
35
|
+
* {@link solveLinear} instead.
|
|
32
36
|
*
|
|
33
37
|
* - https://en.wikipedia.org/wiki/Quadratic_function
|
|
34
38
|
* - https://en.wikipedia.org/wiki/Quadratic_equation
|