mathjs 11.5.1 → 11.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +34 -0
- package/lib/browser/math.js +1 -1
- package/lib/browser/math.js.LICENSE.txt +2 -2
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js +10 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js +2 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js +0 -2
- package/lib/cjs/entry/impureFunctionsAny.generated.js +102 -103
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +41 -42
- package/lib/cjs/entry/pureFunctionsAny.generated.js +405 -372
- package/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/sort.js +1 -1
- package/lib/cjs/function/algebra/simplifyConstant.js +1 -2
- package/lib/cjs/function/arithmetic/add.js +38 -37
- package/lib/cjs/function/arithmetic/dotDivide.js +5 -3
- package/lib/cjs/function/arithmetic/dotMultiply.js +5 -3
- package/lib/cjs/function/arithmetic/dotPow.js +5 -3
- package/lib/cjs/function/arithmetic/expm1.js +1 -1
- package/lib/cjs/function/arithmetic/gcd.js +40 -15
- package/lib/cjs/function/arithmetic/lcm.js +5 -3
- package/lib/cjs/function/arithmetic/mod.js +5 -3
- package/lib/cjs/function/arithmetic/nthRoot.js +5 -3
- package/lib/cjs/function/arithmetic/nthRoots.js +2 -1
- package/lib/cjs/function/arithmetic/round.js +1 -1
- package/lib/cjs/function/arithmetic/sign.js +1 -1
- package/lib/cjs/function/arithmetic/subtract.js +5 -3
- package/lib/cjs/function/bitwise/bitAnd.js +5 -3
- package/lib/cjs/function/bitwise/bitOr.js +5 -3
- package/lib/cjs/function/bitwise/bitXor.js +5 -3
- package/lib/cjs/function/bitwise/leftShift.js +5 -3
- package/lib/cjs/function/bitwise/rightArithShift.js +6 -4
- package/lib/cjs/function/bitwise/rightLogShift.js +5 -3
- package/lib/cjs/function/geometry/distance.js +3 -3
- package/lib/cjs/function/logical/and.js +5 -3
- package/lib/cjs/function/logical/or.js +5 -3
- package/lib/cjs/function/logical/xor.js +5 -3
- package/lib/cjs/function/matrix/column.js +3 -1
- package/lib/cjs/function/matrix/det.js +7 -1
- package/lib/cjs/function/matrix/diff.js +3 -3
- package/lib/cjs/function/matrix/fft.js +43 -4
- package/lib/cjs/function/matrix/getMatrixDataType.js +1 -1
- package/lib/cjs/function/matrix/partitionSelect.js +7 -2
- package/lib/cjs/function/matrix/row.js +3 -1
- package/lib/cjs/function/matrix/subset.js +1 -1
- package/lib/cjs/function/relational/compare.js +5 -3
- package/lib/cjs/function/relational/compareText.js +5 -3
- package/lib/cjs/function/relational/equal.js +5 -3
- package/lib/cjs/function/relational/larger.js +5 -3
- package/lib/cjs/function/relational/largerEq.js +5 -3
- package/lib/cjs/function/relational/smaller.js +5 -3
- package/lib/cjs/function/relational/smallerEq.js +5 -3
- package/lib/cjs/function/relational/unequal.js +5 -3
- package/lib/cjs/function/set/setIsSubset.js +1 -1
- package/lib/cjs/function/set/setSize.js +3 -2
- package/lib/cjs/function/statistics/max.js +1 -1
- package/lib/cjs/function/statistics/quantileSeq.js +4 -3
- package/lib/cjs/function/trigonometry/atan2.js +5 -3
- package/lib/cjs/function/unit/to.js +8 -6
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/type/matrix/utils/broadcast.js +84 -0
- package/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js +27 -20
- package/lib/cjs/version.js +1 -1
- package/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js +10 -0
- package/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js +0 -2
- package/lib/esm/entry/impureFunctionsAny.generated.js +100 -101
- package/lib/esm/entry/impureFunctionsNumber.generated.js +38 -39
- package/lib/esm/entry/pureFunctionsAny.generated.js +332 -299
- package/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/sort.js +1 -1
- package/lib/esm/function/algebra/simplifyConstant.js +1 -2
- package/lib/esm/function/arithmetic/add.js +38 -37
- package/lib/esm/function/arithmetic/dotDivide.js +5 -3
- package/lib/esm/function/arithmetic/dotMultiply.js +5 -3
- package/lib/esm/function/arithmetic/dotPow.js +5 -3
- package/lib/esm/function/arithmetic/expm1.js +1 -1
- package/lib/esm/function/arithmetic/gcd.js +32 -13
- package/lib/esm/function/arithmetic/lcm.js +5 -3
- package/lib/esm/function/arithmetic/mod.js +5 -3
- package/lib/esm/function/arithmetic/nthRoot.js +5 -3
- package/lib/esm/function/arithmetic/nthRoots.js +2 -1
- package/lib/esm/function/arithmetic/round.js +1 -1
- package/lib/esm/function/arithmetic/sign.js +1 -1
- package/lib/esm/function/arithmetic/subtract.js +5 -3
- package/lib/esm/function/bitwise/bitAnd.js +5 -3
- package/lib/esm/function/bitwise/bitOr.js +5 -3
- package/lib/esm/function/bitwise/bitXor.js +5 -3
- package/lib/esm/function/bitwise/leftShift.js +5 -3
- package/lib/esm/function/bitwise/rightArithShift.js +6 -4
- package/lib/esm/function/bitwise/rightLogShift.js +5 -3
- package/lib/esm/function/geometry/distance.js +3 -3
- package/lib/esm/function/logical/and.js +5 -3
- package/lib/esm/function/logical/or.js +5 -3
- package/lib/esm/function/logical/xor.js +5 -3
- package/lib/esm/function/matrix/column.js +3 -1
- package/lib/esm/function/matrix/det.js +7 -1
- package/lib/esm/function/matrix/diff.js +3 -3
- package/lib/esm/function/matrix/fft.js +37 -4
- package/lib/esm/function/matrix/getMatrixDataType.js +1 -1
- package/lib/esm/function/matrix/partitionSelect.js +7 -2
- package/lib/esm/function/matrix/row.js +3 -1
- package/lib/esm/function/matrix/subset.js +1 -1
- package/lib/esm/function/relational/compare.js +5 -3
- package/lib/esm/function/relational/compareText.js +5 -3
- package/lib/esm/function/relational/equal.js +5 -3
- package/lib/esm/function/relational/larger.js +5 -3
- package/lib/esm/function/relational/largerEq.js +5 -3
- package/lib/esm/function/relational/smaller.js +5 -3
- package/lib/esm/function/relational/smallerEq.js +5 -3
- package/lib/esm/function/relational/unequal.js +5 -3
- package/lib/esm/function/set/setIsSubset.js +1 -1
- package/lib/esm/function/set/setSize.js +3 -2
- package/lib/esm/function/statistics/max.js +1 -1
- package/lib/esm/function/statistics/quantileSeq.js +4 -3
- package/lib/esm/function/trigonometry/atan2.js +5 -3
- package/lib/esm/function/unit/to.js +8 -6
- package/lib/esm/type/matrix/utils/broadcast.js +75 -0
- package/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js +25 -20
- package/lib/esm/version.js +1 -1
- package/package.json +14 -14
- package/types/index.d.ts +247 -471
package/types/index.d.ts
CHANGED
@@ -776,7 +776,7 @@ declare namespace math {
|
|
776
776
|
* @param unit The unit to be created
|
777
777
|
* @returns The created unit
|
778
778
|
*/
|
779
|
-
unit(value:
|
779
|
+
unit(value: MathNumericType, unit: string): Unit
|
780
780
|
unit(value: MathCollection, unit: string): Unit[]
|
781
781
|
|
782
782
|
/*************************************************************************
|
@@ -859,8 +859,8 @@ declare namespace math {
|
|
859
859
|
* @param b A column vector with the b values
|
860
860
|
* @returns A column vector with the linear system solution (x)
|
861
861
|
*/
|
862
|
-
lsolve(L: Matrix, b:
|
863
|
-
lsolve(L: MathArray, b:
|
862
|
+
lsolve(L: Matrix, b: MathCollection): Matrix
|
863
|
+
lsolve(L: MathArray, b: MathCollection): MathArray
|
864
864
|
|
865
865
|
/**
|
866
866
|
* Calculate the Matrix LU decomposition with partial pivoting. Matrix A
|
@@ -871,7 +871,7 @@ declare namespace math {
|
|
871
871
|
* @returns The lower triangular matrix, the upper triangular matrix and
|
872
872
|
* the permutation matrix.
|
873
873
|
*/
|
874
|
-
lup(A?:
|
874
|
+
lup(A?: MathCollection): LUDecomposition
|
875
875
|
|
876
876
|
/**
|
877
877
|
* Solves the linear system A * x = b where A is an [n x n] matrix and b
|
@@ -887,19 +887,19 @@ declare namespace math {
|
|
887
887
|
*/
|
888
888
|
lusolve(
|
889
889
|
A: Matrix,
|
890
|
-
b:
|
890
|
+
b: MathCollection,
|
891
891
|
order?: number,
|
892
892
|
threshold?: number
|
893
893
|
): Matrix
|
894
894
|
|
895
895
|
lusolve(
|
896
896
|
A: MathArray,
|
897
|
-
b:
|
897
|
+
b: MathCollection,
|
898
898
|
order?: number,
|
899
899
|
threshold?: number
|
900
900
|
): MathArray
|
901
901
|
|
902
|
-
lusolve(A: LUDecomposition, b:
|
902
|
+
lusolve(A: LUDecomposition, b: MathCollection): Matrix
|
903
903
|
|
904
904
|
/* Finds the roots of a polynomial of degree three or less. Coefficients are given constant first
|
905
905
|
* followed by linear and higher powers in order; coefficients beyond the degree of the polynomial
|
@@ -925,7 +925,7 @@ declare namespace math {
|
|
925
925
|
* decomposition.
|
926
926
|
* @returns Q: the orthogonal matrix and R: the upper triangular matrix
|
927
927
|
*/
|
928
|
-
qr(A:
|
928
|
+
qr(A: MathCollection): QRDecomposition
|
929
929
|
|
930
930
|
rationalize(
|
931
931
|
expr: MathNode | string,
|
@@ -1016,8 +1016,8 @@ declare namespace math {
|
|
1016
1016
|
* @param b A column vector with the b values
|
1017
1017
|
* @returns A column vector with the linear system solution (x)
|
1018
1018
|
*/
|
1019
|
-
usolve(U: Matrix, b:
|
1020
|
-
usolve(U: MathArray, b:
|
1019
|
+
usolve(U: Matrix, b: MathCollection): Matrix
|
1020
|
+
usolve(U: MathArray, b: MathCollection): MathArray
|
1021
1021
|
|
1022
1022
|
/*************************************************************************
|
1023
1023
|
* Arithmetic functions
|
@@ -1029,13 +1029,7 @@ declare namespace math {
|
|
1029
1029
|
* @param x A number or matrix for which to get the absolute value
|
1030
1030
|
* @returns Absolute value of x
|
1031
1031
|
*/
|
1032
|
-
abs(x:
|
1033
|
-
abs(x: BigNumber): BigNumber
|
1034
|
-
abs(x: Fraction): Fraction
|
1035
|
-
abs(x: Complex): Complex
|
1036
|
-
abs(x: MathArray): MathArray
|
1037
|
-
abs(x: Matrix): Matrix
|
1038
|
-
abs(x: Unit): Unit
|
1032
|
+
abs<T extends MathType>(x: T): T
|
1039
1033
|
|
1040
1034
|
/**
|
1041
1035
|
* Add two values, x + y. For matrices, the function is evaluated
|
@@ -1055,10 +1049,8 @@ declare namespace math {
|
|
1055
1049
|
* if false (default) the principal root is returned.
|
1056
1050
|
* @returns Returns the cubic root of x
|
1057
1051
|
*/
|
1058
|
-
cbrt(x: number, allRoots?: boolean): number
|
1059
|
-
cbrt(x: BigNumber): BigNumber
|
1060
1052
|
cbrt(x: Complex, allRoots?: boolean): Complex
|
1061
|
-
cbrt(x:
|
1053
|
+
cbrt<T extends number | BigNumber | Unit>(x: T): T
|
1062
1054
|
|
1063
1055
|
// Rounding functions, grouped for similarity, even though it breaks
|
1064
1056
|
// the alphabetic order among arithmetic functions.
|
@@ -1124,11 +1116,7 @@ declare namespace math {
|
|
1124
1116
|
* @param x Number for which to calculate the cube
|
1125
1117
|
* @returns Cube of x
|
1126
1118
|
*/
|
1127
|
-
cube(x:
|
1128
|
-
cube(x: BigNumber): BigNumber
|
1129
|
-
cube(x: Fraction): Fraction
|
1130
|
-
cube(x: Complex): Complex
|
1131
|
-
cube(x: Unit): Unit
|
1119
|
+
cube<T extends MathNumericType | Unit>(x: T): T
|
1132
1120
|
|
1133
1121
|
/**
|
1134
1122
|
* Divide two values, x / y. To divide matrices, x is multiplied with
|
@@ -1182,9 +1170,7 @@ declare namespace math {
|
|
1182
1170
|
* @param x A number or matrix to exponentiate
|
1183
1171
|
* @returns Exponent of x
|
1184
1172
|
*/
|
1185
|
-
exp(x:
|
1186
|
-
exp(x: BigNumber): BigNumber
|
1187
|
-
exp(x: Complex): Complex
|
1173
|
+
exp<T extends number | BigNumber | Complex>(x: T): T
|
1188
1174
|
|
1189
1175
|
/**
|
1190
1176
|
* Calculate the value of subtracting 1 from the exponential value. For
|
@@ -1192,9 +1178,7 @@ declare namespace math {
|
|
1192
1178
|
* @param x A number or matrix to apply expm1
|
1193
1179
|
* @returns Exponent of x
|
1194
1180
|
*/
|
1195
|
-
expm1(x:
|
1196
|
-
expm1(x: BigNumber): BigNumber
|
1197
|
-
expm1(x: Complex): Complex
|
1181
|
+
expm1<T extends number | BigNumber | Complex>(x: T): T
|
1198
1182
|
|
1199
1183
|
/**
|
1200
1184
|
* Calculate the greatest common divisor for two or more values or
|
@@ -1202,11 +1186,9 @@ declare namespace math {
|
|
1202
1186
|
* @param args Two or more integer numbers
|
1203
1187
|
* @returns The greatest common divisor
|
1204
1188
|
*/
|
1205
|
-
gcd(
|
1206
|
-
|
1207
|
-
|
1208
|
-
gcd(...args: MathArray[]): MathArray
|
1209
|
-
gcd(...args: Matrix[]): Matrix
|
1189
|
+
gcd<T extends (number | BigNumber | Fraction | MathCollection)[]>(
|
1190
|
+
...args: T[]
|
1191
|
+
): T
|
1210
1192
|
|
1211
1193
|
/**
|
1212
1194
|
* Calculate the hypotenusa of a list with values. The hypotenusa is
|
@@ -1218,8 +1200,7 @@ declare namespace math {
|
|
1218
1200
|
* whole matrix.
|
1219
1201
|
* @returns Returns the hypothenuse of the input values.
|
1220
1202
|
*/
|
1221
|
-
hypot(...args:
|
1222
|
-
hypot(...args: BigNumber[]): BigNumber
|
1203
|
+
hypot<T extends (number | BigNumber)[]>(...args: T[]): T
|
1223
1204
|
|
1224
1205
|
/**
|
1225
1206
|
* Calculate the least common multiple for two or more values or arrays.
|
@@ -1229,10 +1210,7 @@ declare namespace math {
|
|
1229
1210
|
* @param b An integer number
|
1230
1211
|
* @returns The least common multiple
|
1231
1212
|
*/
|
1232
|
-
lcm(a:
|
1233
|
-
lcm(a: BigNumber, b: BigNumber): BigNumber
|
1234
|
-
lcm(a: MathArray, b: MathArray): MathArray
|
1235
|
-
lcm(a: Matrix, b: Matrix): Matrix
|
1213
|
+
lcm<T extends number | BigNumber | MathCollection>(a: T, b: T): T
|
1236
1214
|
|
1237
1215
|
/**
|
1238
1216
|
* Calculate the logarithm of a value.
|
@@ -1252,11 +1230,7 @@ declare namespace math {
|
|
1252
1230
|
* @param x Value for which to calculate the logarithm.
|
1253
1231
|
* @returns Returns the 10-base logarithm of x
|
1254
1232
|
*/
|
1255
|
-
log10(x:
|
1256
|
-
log10(x: BigNumber): BigNumber
|
1257
|
-
log10(x: Complex): Complex
|
1258
|
-
log10(x: MathArray): MathArray
|
1259
|
-
log10(x: Matrix): Matrix
|
1233
|
+
log10<T extends number | BigNumber | Complex | MathCollection>(x: T): T
|
1260
1234
|
|
1261
1235
|
/**
|
1262
1236
|
* Calculate the logarithm of a value+1. For matrices, the function is
|
@@ -1264,11 +1238,10 @@ declare namespace math {
|
|
1264
1238
|
* @param x Value for which to calculate the logarithm.
|
1265
1239
|
* @returns Returns the logarithm of x+1
|
1266
1240
|
*/
|
1267
|
-
log1p
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
log1p(x: Matrix, base?: number | BigNumber | Complex): Matrix
|
1241
|
+
log1p<T extends number | BigNumber | Complex | MathCollection>(
|
1242
|
+
x: T,
|
1243
|
+
base?: number | BigNumber | Complex
|
1244
|
+
): T
|
1272
1245
|
|
1273
1246
|
/**
|
1274
1247
|
* Calculate the 2-base of a value. This is the same as calculating
|
@@ -1276,11 +1249,7 @@ declare namespace math {
|
|
1276
1249
|
* @param x Value for which to calculate the logarithm.
|
1277
1250
|
* @returns Returns the 2-base logarithm of x
|
1278
1251
|
*/
|
1279
|
-
log2(x:
|
1280
|
-
log2(x: BigNumber): BigNumber
|
1281
|
-
log2(x: Complex): Complex
|
1282
|
-
log2(x: MathArray): MathArray
|
1283
|
-
log2(x: Matrix): Matrix
|
1252
|
+
log2<T extends number | BigNumber | Complex | MathCollection>(x: T): T
|
1284
1253
|
|
1285
1254
|
/**
|
1286
1255
|
* Calculates the modulus, the remainder of an integer division. For
|
@@ -1309,9 +1278,7 @@ declare namespace math {
|
|
1309
1278
|
|
1310
1279
|
multiply<T extends MathNumericType[]>(x: T, y: T[]): T
|
1311
1280
|
multiply<T extends MathNumericType[]>(x: T[], y: T): T
|
1312
|
-
|
1313
1281
|
multiply<T extends MathArray>(x: T, y: T): T
|
1314
|
-
|
1315
1282
|
multiply(x: Unit, y: Unit): Unit
|
1316
1283
|
multiply(x: number, y: number): number
|
1317
1284
|
multiply(x: MathType, y: MathType): MathType
|
@@ -1359,13 +1326,7 @@ declare namespace math {
|
|
1359
1326
|
* @param x The number for which to determine the sign
|
1360
1327
|
* @returns The sign of x
|
1361
1328
|
*/
|
1362
|
-
sign(x:
|
1363
|
-
sign(x: BigNumber): BigNumber
|
1364
|
-
sign(x: Fraction): Fraction
|
1365
|
-
sign(x: Complex): Complex
|
1366
|
-
sign(x: MathArray): MathArray
|
1367
|
-
sign(x: Matrix): Matrix
|
1368
|
-
sign(x: Unit): Unit
|
1329
|
+
sign<T extends MathType>(x: T): T
|
1369
1330
|
|
1370
1331
|
/**
|
1371
1332
|
* Calculate the square root of a value. For matrices, use either
|
@@ -1375,20 +1336,14 @@ declare namespace math {
|
|
1375
1336
|
* @returns Returns the square root of x
|
1376
1337
|
*/
|
1377
1338
|
sqrt(x: number): number | Complex
|
1378
|
-
sqrt(x:
|
1379
|
-
sqrt(x: Complex): Complex
|
1380
|
-
sqrt(x: Unit): Unit
|
1339
|
+
sqrt<T extends BigNumber | Complex | Unit>(x: T): T
|
1381
1340
|
|
1382
1341
|
/**
|
1383
1342
|
* Compute the square of a value, x * x.
|
1384
1343
|
* @param x Number for which to calculate the square
|
1385
1344
|
* @returns Squared value
|
1386
1345
|
*/
|
1387
|
-
square(x:
|
1388
|
-
square(x: BigNumber): BigNumber
|
1389
|
-
square(x: Fraction): Fraction
|
1390
|
-
square(x: Complex): Complex
|
1391
|
-
square(x: Unit): Unit
|
1346
|
+
square<T extends MathNumericType | Unit>(x: T): T
|
1392
1347
|
|
1393
1348
|
/**
|
1394
1349
|
* Subtract two values, x - y. For matrices, the function is evaluated
|
@@ -1408,13 +1363,7 @@ declare namespace math {
|
|
1408
1363
|
* @param x Number to be inverted
|
1409
1364
|
* @returns Retursn the value with inverted sign
|
1410
1365
|
*/
|
1411
|
-
unaryMinus(x:
|
1412
|
-
unaryMinus(x: BigNumber): BigNumber
|
1413
|
-
unaryMinus(x: Fraction): Fraction
|
1414
|
-
unaryMinus(x: Complex): Complex
|
1415
|
-
unaryMinus(x: MathArray): MathArray
|
1416
|
-
unaryMinus(x: Matrix): Matrix
|
1417
|
-
unaryMinus(x: Unit): Unit
|
1366
|
+
unaryMinus<T extends MathType>(x: T): T
|
1418
1367
|
|
1419
1368
|
/**
|
1420
1369
|
* Unary plus operation. Boolean values and strings will be converted to
|
@@ -1424,14 +1373,7 @@ declare namespace math {
|
|
1424
1373
|
* @returns Returns the input value when numeric, converts to a number
|
1425
1374
|
* when input is non-numeric.
|
1426
1375
|
*/
|
1427
|
-
unaryPlus(x:
|
1428
|
-
unaryPlus(x: BigNumber): BigNumber
|
1429
|
-
unaryPlus(x: Fraction): Fraction
|
1430
|
-
unaryPlus(x: string): string
|
1431
|
-
unaryPlus(x: Complex): Complex
|
1432
|
-
unaryPlus(x: MathArray): MathArray
|
1433
|
-
unaryPlus(x: Matrix): Matrix
|
1434
|
-
unaryPlus(x: Unit): Unit
|
1376
|
+
unaryPlus<T extends string | MathType>(x: T): T
|
1435
1377
|
|
1436
1378
|
/**
|
1437
1379
|
* Calculate the extended greatest common divisor for two values. See
|
@@ -1466,10 +1408,7 @@ declare namespace math {
|
|
1466
1408
|
* @param x Value to not
|
1467
1409
|
* @returns NOT of x
|
1468
1410
|
*/
|
1469
|
-
bitNot(x:
|
1470
|
-
bitNot(x: BigNumber): BigNumber
|
1471
|
-
bitNot(x: MathArray): MathArray
|
1472
|
-
bitNot(x: Matrix): Matrix
|
1411
|
+
bitNot<T extends number | BigNumber | MathCollection>(x: T): T
|
1473
1412
|
|
1474
1413
|
/**
|
1475
1414
|
* Bitwise OR two values, x | y. For matrices, the function is evaluated
|
@@ -1479,10 +1418,7 @@ declare namespace math {
|
|
1479
1418
|
* @param y Second value to or
|
1480
1419
|
* @returns OR of x and y
|
1481
1420
|
*/
|
1482
|
-
bitOr(x:
|
1483
|
-
bitOr(x: BigNumber, y: BigNumber): BigNumber
|
1484
|
-
bitOr(x: MathArray, y: MathArray): MathArray
|
1485
|
-
bitOr(x: Matrix, y: Matrix): Matrix
|
1421
|
+
bitOr<T extends number | BigNumber | MathCollection>(x: T, y: T): T
|
1486
1422
|
|
1487
1423
|
/**
|
1488
1424
|
* Bitwise XOR two values, x ^ y. For matrices, the function is
|
@@ -1547,8 +1483,7 @@ declare namespace math {
|
|
1547
1483
|
* @param n Total number of objects in the set
|
1548
1484
|
* @returns B(n)
|
1549
1485
|
*/
|
1550
|
-
bellNumbers(n:
|
1551
|
-
bellNumbers(n: BigNumber): BigNumber
|
1486
|
+
bellNumbers<T extends number | BigNumber>(n: T): T
|
1552
1487
|
|
1553
1488
|
/**
|
1554
1489
|
* The Catalan Numbers enumerate combinatorial structures of many
|
@@ -1557,8 +1492,7 @@ declare namespace math {
|
|
1557
1492
|
* @param n nth Catalan number
|
1558
1493
|
* @returns Cn(n)
|
1559
1494
|
*/
|
1560
|
-
catalan(n:
|
1561
|
-
catalan(n: BigNumber): BigNumber
|
1495
|
+
catalan<T extends number | BigNumber>(n: T): T
|
1562
1496
|
|
1563
1497
|
/**
|
1564
1498
|
* The composition counts of n into k parts. Composition only takes
|
@@ -1600,8 +1534,7 @@ declare namespace math {
|
|
1600
1534
|
*/
|
1601
1535
|
arg(x: number | Complex): number
|
1602
1536
|
arg(x: BigNumber | Complex): BigNumber
|
1603
|
-
arg(x:
|
1604
|
-
arg(x: Matrix): Matrix
|
1537
|
+
arg<T extends MathCollection>(x: T): T
|
1605
1538
|
|
1606
1539
|
/**
|
1607
1540
|
* Compute the complex conjugate of a complex value. If x = a+bi, the
|
@@ -1622,8 +1555,7 @@ declare namespace math {
|
|
1622
1555
|
* @returns The imaginary part of x
|
1623
1556
|
*/
|
1624
1557
|
im(x: MathJsChain<number | Complex>): MathJsChain<number>
|
1625
|
-
im(x: MathJsChain<
|
1626
|
-
im(x: MathJsChain<MathCollection>): MathJsChain<MathCollection>
|
1558
|
+
im<T extends BigNumber | MathCollection>(x: MathJsChain<T>): MathJsChain<T>
|
1627
1559
|
|
1628
1560
|
/**
|
1629
1561
|
* Get the real part of a complex number. For a complex number a + bi,
|
@@ -1633,8 +1565,7 @@ declare namespace math {
|
|
1633
1565
|
* @returns The real part of x
|
1634
1566
|
*/
|
1635
1567
|
re(x: MathJsChain<number | Complex>): MathJsChain<number>
|
1636
|
-
re(x: MathJsChain<
|
1637
|
-
re(x: MathJsChain<MathCollection>): MathJsChain<MathCollection>
|
1568
|
+
re<T extends BigNumber | MathCollection>(x: MathJsChain<T>): MathJsChain<T>
|
1638
1569
|
|
1639
1570
|
/*************************************************************************
|
1640
1571
|
* Geometry functions
|
@@ -1676,7 +1607,7 @@ declare namespace math {
|
|
1676
1607
|
w: MathCollection,
|
1677
1608
|
x: MathCollection,
|
1678
1609
|
y: MathCollection,
|
1679
|
-
z
|
1610
|
+
z?: MathCollection
|
1680
1611
|
): MathArray
|
1681
1612
|
|
1682
1613
|
/*************************************************************************
|
@@ -1773,7 +1704,7 @@ declare namespace math {
|
|
1773
1704
|
* @param y Second vector
|
1774
1705
|
* @returns Returns the cross product of x and y
|
1775
1706
|
*/
|
1776
|
-
cross(x: MathCollection, y: MathCollection):
|
1707
|
+
cross(x: MathCollection, y: MathCollection): MathCollection
|
1777
1708
|
|
1778
1709
|
/**
|
1779
1710
|
* Calculate the determinant of a matrix.
|
@@ -1801,7 +1732,7 @@ declare namespace math {
|
|
1801
1732
|
X: MathCollection,
|
1802
1733
|
k: number | BigNumber,
|
1803
1734
|
format?: string
|
1804
|
-
):
|
1735
|
+
): MathCollection
|
1805
1736
|
|
1806
1737
|
/**
|
1807
1738
|
* Calculate the dot product of two vectors. The dot product of A = [a1,
|
@@ -1853,10 +1784,10 @@ declare namespace math {
|
|
1853
1784
|
* @returns Matrix X, solving the Sylvester equation
|
1854
1785
|
*/
|
1855
1786
|
sylvester(
|
1856
|
-
A:
|
1857
|
-
B:
|
1858
|
-
C:
|
1859
|
-
):
|
1787
|
+
A: MathCollection,
|
1788
|
+
B: MathCollection,
|
1789
|
+
C: MathCollection
|
1790
|
+
): MathCollection
|
1860
1791
|
|
1861
1792
|
/**
|
1862
1793
|
* Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal
|
@@ -1865,7 +1796,7 @@ declare namespace math {
|
|
1865
1796
|
* @param A Matrix A
|
1866
1797
|
* @returns Object containing both matrix U and T of the Schur Decomposition A=UTU'
|
1867
1798
|
*/
|
1868
|
-
schur(A:
|
1799
|
+
schur(A: MathCollection): SchurDecomposition
|
1869
1800
|
|
1870
1801
|
/**
|
1871
1802
|
* Solves the Continuous-time Lyapunov equation AP+PA'=Q for P, where Q is a positive semidefinite
|
@@ -1875,7 +1806,7 @@ declare namespace math {
|
|
1875
1806
|
* @param Q Matrix Q
|
1876
1807
|
* @returns Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q
|
1877
1808
|
*/
|
1878
|
-
lyap(A:
|
1809
|
+
lyap(A: MathCollection, Q: MathCollection): MathCollection
|
1879
1810
|
|
1880
1811
|
/**
|
1881
1812
|
* Create a 2-dimensional identity matrix with size m x n or n x n. The
|
@@ -1885,16 +1816,16 @@ declare namespace math {
|
|
1885
1816
|
* @returns A matrix with ones on the diagonal
|
1886
1817
|
*/
|
1887
1818
|
identity(
|
1888
|
-
size: number | number[] |
|
1819
|
+
size: number | number[] | MathCollection,
|
1889
1820
|
format?: string
|
1890
|
-
):
|
1821
|
+
): MathCollection | number
|
1891
1822
|
/**
|
1892
1823
|
* @param m The x dimension for the matrix
|
1893
1824
|
* @param n The y dimension for the matrix
|
1894
1825
|
* @param format The Matrix storage format
|
1895
1826
|
* @returns A matrix with ones on the diagonal
|
1896
1827
|
*/
|
1897
|
-
identity(m: number, n: number, format?: string):
|
1828
|
+
identity(m: number, n: number, format?: string): MathCollection | number
|
1898
1829
|
|
1899
1830
|
/**
|
1900
1831
|
* Filter the items in an array or one dimensional matrix.
|
@@ -1906,17 +1837,17 @@ declare namespace math {
|
|
1906
1837
|
* traversed. The function must return a boolean.
|
1907
1838
|
*/
|
1908
1839
|
filter(
|
1909
|
-
x:
|
1840
|
+
x: MathCollection | string[],
|
1910
1841
|
test:
|
1911
1842
|
| ((
|
1912
1843
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1913
1844
|
value: any,
|
1914
1845
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1915
1846
|
index: any,
|
1916
|
-
matrix:
|
1847
|
+
matrix: MathCollection | string[]
|
1917
1848
|
) => boolean)
|
1918
1849
|
| RegExp
|
1919
|
-
):
|
1850
|
+
): MathCollection
|
1920
1851
|
|
1921
1852
|
/**
|
1922
1853
|
* Flatten a multi dimensional matrix into a single dimensional matrix.
|
@@ -1933,7 +1864,7 @@ declare namespace math {
|
|
1933
1864
|
* parameters: the value of the element, the index of the element, and
|
1934
1865
|
* the Matrix/array being traversed.
|
1935
1866
|
*/
|
1936
|
-
forEach<T extends
|
1867
|
+
forEach<T extends MathCollection>(
|
1937
1868
|
x: T,
|
1938
1869
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1939
1870
|
callback: (value: any, index: any, matrix: T) => void
|
@@ -1952,7 +1883,7 @@ declare namespace math {
|
|
1952
1883
|
* @param y Second vector
|
1953
1884
|
* @returns Returns the kronecker product of x and y
|
1954
1885
|
*/
|
1955
|
-
kron(x:
|
1886
|
+
kron(x: MathCollection, y: MathCollection): Matrix
|
1956
1887
|
|
1957
1888
|
/**
|
1958
1889
|
* Iterate over all elements of a matrix/array, and executes the given
|
@@ -1963,7 +1894,7 @@ declare namespace math {
|
|
1963
1894
|
* the Matrix/array being traversed.
|
1964
1895
|
* @returns Transformed map of x
|
1965
1896
|
*/
|
1966
|
-
map<T extends
|
1897
|
+
map<T extends MathCollection>(
|
1967
1898
|
x: T,
|
1968
1899
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1969
1900
|
callback: (value: any, index: any, matrix: T) => MathType | string
|
@@ -2141,7 +2072,7 @@ declare namespace math {
|
|
2141
2072
|
* b, and 0 when a == b. Default value: ‘asc’
|
2142
2073
|
* @returns Returns the sorted matrix
|
2143
2074
|
*/
|
2144
|
-
sort<T extends
|
2075
|
+
sort<T extends MathCollection>(
|
2145
2076
|
x: T,
|
2146
2077
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2147
2078
|
compare: ((a: any, b: any) => number) | 'asc' | 'desc' | 'natural'
|
@@ -2422,10 +2353,7 @@ declare namespace math {
|
|
2422
2353
|
* @returns Returns true when the input matrices have the same size and
|
2423
2354
|
* each of their elements is equal.
|
2424
2355
|
*/
|
2425
|
-
deepEqual(
|
2426
|
-
x: MathType,
|
2427
|
-
y: MathType
|
2428
|
-
): number | BigNumber | Fraction | Complex | Unit | MathCollection
|
2356
|
+
deepEqual(x: MathType, y: MathType): MathType
|
2429
2357
|
|
2430
2358
|
/**
|
2431
2359
|
* Test whether two values are equal.
|
@@ -2594,10 +2522,7 @@ declare namespace math {
|
|
2594
2522
|
* @returns The number of how many times the multiset contains the
|
2595
2523
|
* element
|
2596
2524
|
*/
|
2597
|
-
setMultiplicity(
|
2598
|
-
e: number | BigNumber | Fraction | Complex,
|
2599
|
-
a: MathCollection
|
2600
|
-
): number
|
2525
|
+
setMultiplicity(e: MathNumericType, a: MathCollection): number
|
2601
2526
|
|
2602
2527
|
/**
|
2603
2528
|
* Create the powerset of a (multi)set. (The powerset contains very
|
@@ -2970,8 +2895,7 @@ declare namespace math {
|
|
2970
2895
|
* @returns The arc cosine of x
|
2971
2896
|
*/
|
2972
2897
|
acos(x: number): number | Complex
|
2973
|
-
acos(x:
|
2974
|
-
acos(x: Complex): Complex
|
2898
|
+
acos<T extends BigNumber | Complex>(x: T): T
|
2975
2899
|
|
2976
2900
|
/**
|
2977
2901
|
* Calculate the hyperbolic arccos of a value, defined as acosh(x) =
|
@@ -2980,8 +2904,7 @@ declare namespace math {
|
|
2980
2904
|
* @returns The hyperbolic arccosine of x
|
2981
2905
|
*/
|
2982
2906
|
acosh(x: number): number | Complex
|
2983
|
-
acosh(x:
|
2984
|
-
acosh(x: Complex): Complex
|
2907
|
+
acosh<T extends BigNumber | Complex>(x: T): T
|
2985
2908
|
|
2986
2909
|
/**
|
2987
2910
|
* Calculate the inverse cotangent of a value.
|
@@ -2989,8 +2912,7 @@ declare namespace math {
|
|
2989
2912
|
* @returns The arc cotangent of x
|
2990
2913
|
*/
|
2991
2914
|
acot(x: number): number
|
2992
|
-
acot(x:
|
2993
|
-
acot(x: Complex): Complex
|
2915
|
+
acot<T extends BigNumber | Complex>(x: T): T
|
2994
2916
|
|
2995
2917
|
/**
|
2996
2918
|
* Calculate the hyperbolic arccotangent of a value, defined as acoth(x)
|
@@ -2999,8 +2921,7 @@ declare namespace math {
|
|
2999
2921
|
* @returns The hyperbolic arccotangent of x
|
3000
2922
|
*/
|
3001
2923
|
acoth(x: number): number
|
3002
|
-
acoth(x:
|
3003
|
-
acoth(x: Complex): Complex
|
2924
|
+
acoth<T extends BigNumber | Complex>(x: T): T
|
3004
2925
|
|
3005
2926
|
/**
|
3006
2927
|
* Calculate the inverse cosecant of a value.
|
@@ -3008,8 +2929,7 @@ declare namespace math {
|
|
3008
2929
|
* @returns The arc cosecant of x
|
3009
2930
|
*/
|
3010
2931
|
acsc(x: number): number | Complex
|
3011
|
-
acsc(x:
|
3012
|
-
acsc(x: Complex): Complex
|
2932
|
+
acsc<T extends BigNumber | Complex>(x: T): T
|
3013
2933
|
|
3014
2934
|
/**
|
3015
2935
|
* Calculate the hyperbolic arccosecant of a value, defined as acsch(x)
|
@@ -3018,8 +2938,7 @@ declare namespace math {
|
|
3018
2938
|
* @returns The hyperbolic arccosecant of x
|
3019
2939
|
*/
|
3020
2940
|
acsch(x: number): number
|
3021
|
-
acsch(x:
|
3022
|
-
acsch(x: Complex): Complex
|
2941
|
+
acsch<T extends BigNumber | Complex>(x: T): T
|
3023
2942
|
|
3024
2943
|
/**
|
3025
2944
|
* Calculate the inverse secant of a value.
|
@@ -3027,8 +2946,7 @@ declare namespace math {
|
|
3027
2946
|
* @returns The arc secant of x
|
3028
2947
|
*/
|
3029
2948
|
asec(x: number): number | Complex
|
3030
|
-
asec(x:
|
3031
|
-
asec(x: Complex): Complex
|
2949
|
+
asec<T extends BigNumber | Complex>(x: T): T
|
3032
2950
|
|
3033
2951
|
/**
|
3034
2952
|
* Calculate the hyperbolic arcsecant of a value, defined as asech(x) =
|
@@ -3037,8 +2955,7 @@ declare namespace math {
|
|
3037
2955
|
* @returns The hyperbolic arcsecant of x
|
3038
2956
|
*/
|
3039
2957
|
asech(x: number): number | Complex
|
3040
|
-
asech(x:
|
3041
|
-
asech(x: Complex): Complex
|
2958
|
+
asech<T extends BigNumber | Complex>(x: T): T
|
3042
2959
|
|
3043
2960
|
/**
|
3044
2961
|
* Calculate the inverse sine of a value.
|
@@ -3046,8 +2963,7 @@ declare namespace math {
|
|
3046
2963
|
* @returns The arc sine of x
|
3047
2964
|
*/
|
3048
2965
|
asin(x: number): number | Complex
|
3049
|
-
asin(x:
|
3050
|
-
asin(x: Complex): Complex
|
2966
|
+
asin<T extends BigNumber | Complex>(x: T): T
|
3051
2967
|
|
3052
2968
|
/**
|
3053
2969
|
* Calculate the hyperbolic arcsine of a value, defined as asinh(x) =
|
@@ -3055,18 +2971,14 @@ declare namespace math {
|
|
3055
2971
|
* @param x Function input
|
3056
2972
|
* @returns The hyperbolic arcsine of x
|
3057
2973
|
*/
|
3058
|
-
asinh(x:
|
3059
|
-
asinh(x: BigNumber): BigNumber
|
3060
|
-
asinh(x: Complex): Complex
|
2974
|
+
asinh<T extends number | BigNumber | Complex>(x: T): T
|
3061
2975
|
|
3062
2976
|
/**
|
3063
2977
|
* Calculate the inverse tangent of a value.
|
3064
2978
|
* @param x Function input
|
3065
2979
|
* @returns The arc tangent of x
|
3066
2980
|
*/
|
3067
|
-
atan(x:
|
3068
|
-
atan(x: BigNumber): BigNumber
|
3069
|
-
atan(x: Complex): Complex
|
2981
|
+
atan<T extends number | BigNumber | Complex>(x: T): T
|
3070
2982
|
|
3071
2983
|
/**
|
3072
2984
|
* Calculate the inverse tangent function with two arguments, y/x. By
|
@@ -3075,8 +2987,7 @@ declare namespace math {
|
|
3075
2987
|
* @param x Function input
|
3076
2988
|
* @returns Four quadrant inverse tangent
|
3077
2989
|
*/
|
3078
|
-
atan2(y:
|
3079
|
-
atan2(y: MathCollection, x: MathCollection): MathCollection
|
2990
|
+
atan2<T extends number | MathCollection>(y: T, x: T): T
|
3080
2991
|
|
3081
2992
|
/**
|
3082
2993
|
* Calculate the hyperbolic arctangent of a value, defined as atanh(x) =
|
@@ -3085,8 +2996,7 @@ declare namespace math {
|
|
3085
2996
|
* @returns The hyperbolic arctangent of x
|
3086
2997
|
*/
|
3087
2998
|
atanh(x: number): number | Complex
|
3088
|
-
atanh(x:
|
3089
|
-
atanh(x: Complex): Complex
|
2999
|
+
atanh<T extends BigNumber | Complex>(x: T): T
|
3090
3000
|
|
3091
3001
|
/**
|
3092
3002
|
* Calculate the cosine of a value.
|
@@ -3094,8 +3004,7 @@ declare namespace math {
|
|
3094
3004
|
* @returns The cosine of x
|
3095
3005
|
*/
|
3096
3006
|
cos(x: number | Unit): number
|
3097
|
-
cos(x:
|
3098
|
-
cos(x: Complex): Complex
|
3007
|
+
cos<T extends BigNumber | Complex>(x: T): T
|
3099
3008
|
|
3100
3009
|
/**
|
3101
3010
|
* Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2
|
@@ -3104,8 +3013,7 @@ declare namespace math {
|
|
3104
3013
|
* @returns The hyperbolic cosine of x
|
3105
3014
|
*/
|
3106
3015
|
cosh(x: number | Unit): number
|
3107
|
-
cosh(x:
|
3108
|
-
cosh(x: Complex): Complex
|
3016
|
+
cosh<T extends BigNumber | Complex>(x: T): T
|
3109
3017
|
|
3110
3018
|
/**
|
3111
3019
|
* Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x).
|
@@ -3113,8 +3021,7 @@ declare namespace math {
|
|
3113
3021
|
* @returns The cotangent of x
|
3114
3022
|
*/
|
3115
3023
|
cot(x: number | Unit): number
|
3116
|
-
cot(x:
|
3117
|
-
cot(x: Complex): Complex
|
3024
|
+
cot<T extends BigNumber | Complex>(x: T): T
|
3118
3025
|
|
3119
3026
|
/**
|
3120
3027
|
* Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1
|
@@ -3123,8 +3030,7 @@ declare namespace math {
|
|
3123
3030
|
* @returns The hyperbolic cotangent of x
|
3124
3031
|
*/
|
3125
3032
|
coth(x: number | Unit): number
|
3126
|
-
coth(x:
|
3127
|
-
coth(x: Complex): Complex
|
3033
|
+
coth<T extends BigNumber | Complex>(x: T): T
|
3128
3034
|
|
3129
3035
|
/**
|
3130
3036
|
* Calculate the cosecant of a value, defined as csc(x) = 1/sin(x).
|
@@ -3132,8 +3038,7 @@ declare namespace math {
|
|
3132
3038
|
* @returns The cosecant hof x
|
3133
3039
|
*/
|
3134
3040
|
csc(x: number | Unit): number
|
3135
|
-
csc(x:
|
3136
|
-
csc(x: Complex): Complex
|
3041
|
+
csc<T extends BigNumber | Complex>(x: T): T
|
3137
3042
|
|
3138
3043
|
/**
|
3139
3044
|
* Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1
|
@@ -3142,8 +3047,7 @@ declare namespace math {
|
|
3142
3047
|
* @returns The hyperbolic cosecant of x
|
3143
3048
|
*/
|
3144
3049
|
csch(x: number | Unit): number
|
3145
|
-
csch(x:
|
3146
|
-
csch(x: Complex): Complex
|
3050
|
+
csch<T extends BigNumber | Complex>(x: T): T
|
3147
3051
|
|
3148
3052
|
/**
|
3149
3053
|
* Calculate the secant of a value, defined as sec(x) = 1/cos(x).
|
@@ -3151,8 +3055,7 @@ declare namespace math {
|
|
3151
3055
|
* @returns The secant of x
|
3152
3056
|
*/
|
3153
3057
|
sec(x: number | Unit): number
|
3154
|
-
sec(x:
|
3155
|
-
sec(x: Complex): Complex
|
3058
|
+
sec<T extends BigNumber | Complex>(x: T): T
|
3156
3059
|
|
3157
3060
|
/**
|
3158
3061
|
* Calculate the hyperbolic secant of a value, defined as sech(x) = 1 /
|
@@ -3161,8 +3064,7 @@ declare namespace math {
|
|
3161
3064
|
* @returns The hyperbolic secant of x
|
3162
3065
|
*/
|
3163
3066
|
sech(x: number | Unit): number
|
3164
|
-
sech(x:
|
3165
|
-
sech(x: Complex): Complex
|
3067
|
+
sech<T extends BigNumber | Complex>(x: T): T
|
3166
3068
|
|
3167
3069
|
/**
|
3168
3070
|
* Calculate the sine of a value.
|
@@ -3170,8 +3072,7 @@ declare namespace math {
|
|
3170
3072
|
* @returns The sine of x
|
3171
3073
|
*/
|
3172
3074
|
sin(x: number | Unit): number
|
3173
|
-
sin(x:
|
3174
|
-
sin(x: Complex): Complex
|
3075
|
+
sin<T extends BigNumber | Complex>(x: T): T
|
3175
3076
|
|
3176
3077
|
/**
|
3177
3078
|
* Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 *
|
@@ -3180,8 +3081,7 @@ declare namespace math {
|
|
3180
3081
|
* @returns The hyperbolic sine of x
|
3181
3082
|
*/
|
3182
3083
|
sinh(x: number | Unit): number
|
3183
|
-
sinh(x:
|
3184
|
-
sinh(x: Complex): Complex
|
3084
|
+
sinh<T extends BigNumber | Complex>(x: T): T
|
3185
3085
|
|
3186
3086
|
/**
|
3187
3087
|
* Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x).
|
@@ -3189,8 +3089,7 @@ declare namespace math {
|
|
3189
3089
|
* @returns The tangent of x
|
3190
3090
|
*/
|
3191
3091
|
tan(x: number | Unit): number
|
3192
|
-
tan(x:
|
3193
|
-
tan(x: Complex): Complex
|
3092
|
+
tan<T extends BigNumber | Complex>(x: T): T
|
3194
3093
|
|
3195
3094
|
/**
|
3196
3095
|
* Calculate the hyperbolic tangent of a value, defined as tanh(x) =
|
@@ -3199,8 +3098,7 @@ declare namespace math {
|
|
3199
3098
|
* @returns The hyperbolic tangent of x
|
3200
3099
|
*/
|
3201
3100
|
tanh(x: number | Unit): number
|
3202
|
-
tanh(x:
|
3203
|
-
tanh(x: Complex): Complex
|
3101
|
+
tanh<T extends BigNumber | Complex>(x: T): T
|
3204
3102
|
|
3205
3103
|
/*************************************************************************
|
3206
3104
|
* Unit functions
|
@@ -3396,9 +3294,7 @@ declare namespace math {
|
|
3396
3294
|
* @returns Returns true when x is zero. Throws an error in case of an
|
3397
3295
|
* unknown data type.
|
3398
3296
|
*/
|
3399
|
-
isZero(
|
3400
|
-
x: number | BigNumber | Fraction | MathCollection | Unit | Complex
|
3401
|
-
): boolean
|
3297
|
+
isZero(x: MathType): boolean
|
3402
3298
|
|
3403
3299
|
/**
|
3404
3300
|
* Determine the type of a variable.
|
@@ -3784,7 +3680,7 @@ declare namespace math {
|
|
3784
3680
|
apply(
|
3785
3681
|
dim: number,
|
3786
3682
|
callback: (array: MathCollection) => number
|
3787
|
-
):
|
3683
|
+
): MathCollection
|
3788
3684
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3789
3685
|
get(index: number[]): any
|
3790
3686
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -4395,11 +4291,7 @@ declare namespace math {
|
|
4395
4291
|
* @param unit The unit to be created
|
4396
4292
|
*/
|
4397
4293
|
unit(this: MathJsChain<string>, unit?: string): MathJsChain<Unit>
|
4398
|
-
unit(this: MathJsChain<
|
4399
|
-
unit(
|
4400
|
-
this: MathJsChain<number | BigNumber>,
|
4401
|
-
unit?: string
|
4402
|
-
): MathJsChain<Unit>
|
4294
|
+
unit(this: MathJsChain<MathNumericType>, unit?: string): MathJsChain<Unit>
|
4403
4295
|
unit(this: MathJsChain<MathCollection>, unit?: string): MathJsChain<Unit[]>
|
4404
4296
|
|
4405
4297
|
/*************************************************************************
|
@@ -4488,13 +4380,10 @@ declare namespace math {
|
|
4488
4380
|
* must be a lower triangular matrix.
|
4489
4381
|
* @param b A column vector with the b values
|
4490
4382
|
*/
|
4491
|
-
lsolve(
|
4492
|
-
this: MathJsChain<Matrix>,
|
4493
|
-
b: Matrix | MathArray
|
4494
|
-
): MathJsChain<Matrix>
|
4383
|
+
lsolve(this: MathJsChain<Matrix>, b: MathCollection): MathJsChain<Matrix>
|
4495
4384
|
lsolve(
|
4496
4385
|
this: MathJsChain<MathArray>,
|
4497
|
-
b:
|
4386
|
+
b: MathCollection
|
4498
4387
|
): MathJsChain<MathArray>
|
4499
4388
|
|
4500
4389
|
/**
|
@@ -4502,7 +4391,7 @@ declare namespace math {
|
|
4502
4391
|
* is decomposed in two matrices (L, U) and a row permutation vector p
|
4503
4392
|
* where A[p,:] = L * U
|
4504
4393
|
*/
|
4505
|
-
lup(this: MathJsChain<
|
4394
|
+
lup(this: MathJsChain<MathCollection>): MathJsChain<LUDecomposition>
|
4506
4395
|
|
4507
4396
|
/**
|
4508
4397
|
* Solves the linear system A * x = b where A is an [n x n] matrix and b
|
@@ -4515,21 +4404,21 @@ declare namespace math {
|
|
4515
4404
|
*/
|
4516
4405
|
lusolve(
|
4517
4406
|
this: MathJsChain<Matrix>,
|
4518
|
-
b:
|
4407
|
+
b: MathCollection,
|
4519
4408
|
order?: number,
|
4520
4409
|
threshold?: number
|
4521
4410
|
): MathJsChain<Matrix>
|
4522
4411
|
|
4523
4412
|
lusolve(
|
4524
4413
|
this: MathJsChain<MathArray>,
|
4525
|
-
b:
|
4414
|
+
b: MathCollection,
|
4526
4415
|
order?: number,
|
4527
4416
|
threshold?: number
|
4528
4417
|
): MathJsChain<MathArray>
|
4529
4418
|
|
4530
4419
|
lusolve(
|
4531
4420
|
this: MathJsChain<LUDecomposition>,
|
4532
|
-
b:
|
4421
|
+
b: MathCollection
|
4533
4422
|
): MathJsChain<Matrix>
|
4534
4423
|
|
4535
4424
|
/**
|
@@ -4537,7 +4426,7 @@ declare namespace math {
|
|
4537
4426
|
* matrices (Q, R) where Q is an orthogonal matrix and R is an upper
|
4538
4427
|
* triangular matrix.
|
4539
4428
|
*/
|
4540
|
-
qr(this: MathJsChain<
|
4429
|
+
qr(this: MathJsChain<MathCollection>): MathJsChain<QRDecomposition>
|
4541
4430
|
|
4542
4431
|
/**
|
4543
4432
|
* Transform a rationalizable expression in a rational fraction. If
|
@@ -4606,13 +4495,10 @@ declare namespace math {
|
|
4606
4495
|
* must be an upper triangular matrix. U * x = b
|
4607
4496
|
* @param b A column vector with the b values
|
4608
4497
|
*/
|
4609
|
-
usolve(
|
4610
|
-
this: MathJsChain<Matrix>,
|
4611
|
-
b: Matrix | MathArray
|
4612
|
-
): MathJsChain<Matrix>
|
4498
|
+
usolve(this: MathJsChain<Matrix>, b: MathCollection): MathJsChain<Matrix>
|
4613
4499
|
usolve(
|
4614
4500
|
this: MathJsChain<MathArray>,
|
4615
|
-
b:
|
4501
|
+
b: MathCollection
|
4616
4502
|
): MathJsChain<MathArray>
|
4617
4503
|
|
4618
4504
|
/*************************************************************************
|
@@ -4623,13 +4509,7 @@ declare namespace math {
|
|
4623
4509
|
* Calculate the absolute value of a number. For matrices, the function
|
4624
4510
|
* is evaluated element wise.
|
4625
4511
|
*/
|
4626
|
-
abs(this: MathJsChain<
|
4627
|
-
abs(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
4628
|
-
abs(this: MathJsChain<Fraction>): MathJsChain<Fraction>
|
4629
|
-
abs(this: MathJsChain<Complex>): MathJsChain<Complex>
|
4630
|
-
abs(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
4631
|
-
abs(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
4632
|
-
abs(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4512
|
+
abs<T extends MathType>(this: MathJsChain<T>): MathJsChain<T>
|
4633
4513
|
|
4634
4514
|
/**
|
4635
4515
|
* Add two values, x + y. For matrices, the function is evaluated
|
@@ -4661,10 +4541,10 @@ declare namespace math {
|
|
4661
4541
|
* a number or complex number. If true, all complex roots are returned,
|
4662
4542
|
* if false (default) the principal root is returned.
|
4663
4543
|
*/
|
4664
|
-
cbrt
|
4665
|
-
|
4666
|
-
|
4667
|
-
|
4544
|
+
cbrt<T extends number | BigNumber | Complex | Unit>(
|
4545
|
+
this: MathJsChain<T>,
|
4546
|
+
allRoots?: boolean
|
4547
|
+
): MathJsChain<T>
|
4668
4548
|
|
4669
4549
|
// Rounding functions grouped for similarity
|
4670
4550
|
|
@@ -4674,56 +4554,40 @@ declare namespace math {
|
|
4674
4554
|
* function is evaluated element wise.
|
4675
4555
|
* @param n Number of decimals Default value: 0.
|
4676
4556
|
*/
|
4677
|
-
ceil(
|
4678
|
-
this: MathJsChain<
|
4679
|
-
n?: number | BigNumber | MathCollection
|
4680
|
-
): MathJsChain<MathNumericType>
|
4681
|
-
ceil(
|
4682
|
-
this: MathJsChain<MathCollection>,
|
4557
|
+
ceil<T extends MathNumericType | MathCollection>(
|
4558
|
+
this: MathJsChain<T>,
|
4683
4559
|
n?: number | BigNumber | MathCollection
|
4684
|
-
): MathJsChain<
|
4560
|
+
): MathJsChain<T>
|
4685
4561
|
|
4686
4562
|
/**
|
4687
4563
|
* Round a value towards zero. For matrices, the function is evaluated
|
4688
4564
|
* element wise.
|
4689
4565
|
* @param n Number of decimals Default value: 0.
|
4690
4566
|
*/
|
4691
|
-
fix(
|
4692
|
-
this: MathJsChain<
|
4693
|
-
n?: number | BigNumber | MathCollection
|
4694
|
-
): MathJsChain<MathNumericType>
|
4695
|
-
fix(
|
4696
|
-
this: MathJsChain<MathCollection>,
|
4567
|
+
fix<T extends MathNumericType | MathCollection>(
|
4568
|
+
this: MathJsChain<T>,
|
4697
4569
|
n?: number | BigNumber | MathCollection
|
4698
|
-
): MathJsChain<
|
4570
|
+
): MathJsChain<T>
|
4699
4571
|
|
4700
4572
|
/**
|
4701
4573
|
* Round a value towards minus infinity. For matrices, the function is
|
4702
4574
|
* evaluated element wise.
|
4703
4575
|
* @param n Number of decimals Default value: 0.
|
4704
4576
|
*/
|
4705
|
-
floor(
|
4706
|
-
this: MathJsChain<
|
4707
|
-
n?: number | BigNumber | MathCollection
|
4708
|
-
): MathJsChain<MathNumericType>
|
4709
|
-
floor(
|
4710
|
-
this: MathJsChain<MathCollection>,
|
4577
|
+
floor<T extends MathNumericType | MathCollection>(
|
4578
|
+
this: MathJsChain<T>,
|
4711
4579
|
n?: number | BigNumber | MathCollection
|
4712
|
-
): MathJsChain<
|
4580
|
+
): MathJsChain<T>
|
4713
4581
|
|
4714
4582
|
/**
|
4715
4583
|
* Round a value towards the nearest integer. For matrices, the function
|
4716
4584
|
* is evaluated element wise.
|
4717
4585
|
* @param n Number of decimals Default value: 0.
|
4718
4586
|
*/
|
4719
|
-
round(
|
4720
|
-
this: MathJsChain<
|
4721
|
-
n?: number | BigNumber | MathCollection
|
4722
|
-
): MathJsChain<MathNumericType>
|
4723
|
-
round(
|
4724
|
-
this: MathJsChain<MathCollection>,
|
4587
|
+
round<T extends MathNumericType | MathCollection>(
|
4588
|
+
this: MathJsChain<T>,
|
4725
4589
|
n?: number | BigNumber | MathCollection
|
4726
|
-
): MathJsChain<
|
4590
|
+
): MathJsChain<T>
|
4727
4591
|
|
4728
4592
|
// End of rounding group
|
4729
4593
|
|
@@ -4731,11 +4595,7 @@ declare namespace math {
|
|
4731
4595
|
* Compute the cube of a value, x * x * x. For matrices, the function is
|
4732
4596
|
* evaluated element wise.
|
4733
4597
|
*/
|
4734
|
-
cube(this: MathJsChain<
|
4735
|
-
cube(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
4736
|
-
cube(this: MathJsChain<Fraction>): MathJsChain<Fraction>
|
4737
|
-
cube(this: MathJsChain<Complex>): MathJsChain<Complex>
|
4738
|
-
cube(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4598
|
+
cube<T extends MathNumericType | Unit>(this: MathJsChain<T>): MathJsChain<T>
|
4739
4599
|
|
4740
4600
|
/**
|
4741
4601
|
* Divide two values, x / y. To divide matrices, x is multiplied with
|
@@ -4800,33 +4660,27 @@ declare namespace math {
|
|
4800
4660
|
* Calculate the exponent of a value. For matrices, the function is
|
4801
4661
|
* evaluated element wise.
|
4802
4662
|
*/
|
4803
|
-
exp
|
4804
|
-
|
4805
|
-
|
4663
|
+
exp<T extends number | BigNumber | Complex>(
|
4664
|
+
this: MathJsChain<T>
|
4665
|
+
): MathJsChain<T>
|
4806
4666
|
|
4807
4667
|
/**
|
4808
4668
|
* Calculate the value of subtracting 1 from the exponential value. For
|
4809
4669
|
* matrices, the function is evaluated element wise.
|
4810
4670
|
*/
|
4811
|
-
expm1
|
4812
|
-
|
4813
|
-
|
4671
|
+
expm1<T extends number | BigNumber | Complex>(
|
4672
|
+
this: MathJsChain<T>
|
4673
|
+
): MathJsChain<T>
|
4814
4674
|
|
4815
4675
|
/**
|
4816
4676
|
* Calculate the greatest common divisor for two or more values or
|
4817
4677
|
* arrays. For matrices, the function is evaluated element wise.
|
4818
4678
|
*/
|
4819
|
-
gcd
|
4820
|
-
|
4821
|
-
|
4822
|
-
|
4823
|
-
): MathJsChain<BigNumber>
|
4679
|
+
gcd<T extends number | BigNumber | MathCollection>(
|
4680
|
+
this: MathJsChain<T[]>,
|
4681
|
+
...args: T[]
|
4682
|
+
): MathJsChain<T>
|
4824
4683
|
gcd(this: MathJsChain<Complex[]>, ...args: Fraction[]): MathJsChain<Complex>
|
4825
|
-
gcd(
|
4826
|
-
this: MathJsChain<MathArray[]>,
|
4827
|
-
...args: MathArray[]
|
4828
|
-
): MathJsChain<MathArray>
|
4829
|
-
gcd(this: MathJsChain<Matrix[]>, ...args: Matrix[]): MathJsChain<Matrix>
|
4830
4684
|
|
4831
4685
|
/**
|
4832
4686
|
* Calculate the hypotenusa of a list with values. The hypotenusa is
|
@@ -4834,8 +4688,7 @@ declare namespace math {
|
|
4834
4688
|
* matrix input, the hypotenusa is calculated for all values in the
|
4835
4689
|
* matrix.
|
4836
4690
|
*/
|
4837
|
-
hypot(this: MathJsChain<
|
4838
|
-
hypot(this: MathJsChain<BigNumber[]>): MathJsChain<BigNumber>
|
4691
|
+
hypot<T extends number | BigNumber>(this: MathJsChain<T[]>): MathJsChain<T>
|
4839
4692
|
|
4840
4693
|
/**
|
4841
4694
|
* Calculate the least common multiple for two or more values or arrays.
|
@@ -4843,10 +4696,10 @@ declare namespace math {
|
|
4843
4696
|
* the function is evaluated element wise.
|
4844
4697
|
* @param b An integer number
|
4845
4698
|
*/
|
4846
|
-
lcm
|
4847
|
-
|
4848
|
-
|
4849
|
-
|
4699
|
+
lcm<T extends number | BigNumber | MathCollection>(
|
4700
|
+
this: MathJsChain<T>,
|
4701
|
+
b: T
|
4702
|
+
): MathJsChain<T>
|
4850
4703
|
|
4851
4704
|
/**
|
4852
4705
|
* Calculate the logarithm of a value. For matrices, the function is
|
@@ -4864,11 +4717,9 @@ declare namespace math {
|
|
4864
4717
|
* log(x, 10). For matrices, the function is evaluated element wise.
|
4865
4718
|
*/
|
4866
4719
|
|
4867
|
-
log10
|
4868
|
-
|
4869
|
-
|
4870
|
-
log10(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
4871
|
-
log10(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
4720
|
+
log10<T extends number | BigNumber | Complex | MathCollection>(
|
4721
|
+
this: MathJsChain<T>
|
4722
|
+
): MathJsChain<T>
|
4872
4723
|
|
4873
4724
|
/**
|
4874
4725
|
* Calculate the logarithm of a value+1. For matrices, the function is
|
@@ -4900,11 +4751,9 @@ declare namespace math {
|
|
4900
4751
|
* log(x, 2). For matrices, the function is evaluated element wise.
|
4901
4752
|
*/
|
4902
4753
|
|
4903
|
-
log2
|
4904
|
-
|
4905
|
-
|
4906
|
-
log2(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
4907
|
-
log2(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
4754
|
+
log2<T extends number | BigNumber | Complex | MathCollection>(
|
4755
|
+
this: MathJsChain<T>
|
4756
|
+
): MathJsChain<T>
|
4908
4757
|
|
4909
4758
|
/**
|
4910
4759
|
* Calculates the modulus, the remainder of an integer division. For
|
@@ -4923,7 +4772,7 @@ declare namespace math {
|
|
4923
4772
|
* matrix product is calculated.
|
4924
4773
|
* @param y The second value to multiply
|
4925
4774
|
*/
|
4926
|
-
multiply<T extends
|
4775
|
+
multiply<T extends MathCollection>(
|
4927
4776
|
this: MathJsChain<T>,
|
4928
4777
|
y: MathType
|
4929
4778
|
): MathJsChain<T>
|
@@ -4971,38 +4820,23 @@ declare namespace math {
|
|
4971
4820
|
* @param x The number for which to determine the sign
|
4972
4821
|
* @returns The sign of x
|
4973
4822
|
*/
|
4974
|
-
sign(this: MathJsChain<
|
4975
|
-
sign(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
4976
|
-
sign(this: MathJsChain<Fraction>): MathJsChain<Fraction>
|
4977
|
-
sign(this: MathJsChain<Complex>): MathJsChain<Complex>
|
4978
|
-
sign(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
4979
|
-
sign(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
4980
|
-
sign(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4823
|
+
sign<T extends MathType>(this: MathJsChain<T>): MathJsChain<T>
|
4981
4824
|
|
4982
4825
|
/**
|
4983
4826
|
* Calculate the square root of a value. For matrices, the function is
|
4984
4827
|
* evaluated element wise.
|
4985
4828
|
*/
|
4986
4829
|
|
4987
|
-
sqrt
|
4988
|
-
|
4989
|
-
|
4990
|
-
sqrt(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
4991
|
-
sqrt(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
4992
|
-
sqrt(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4830
|
+
sqrt<T extends number | BigNumber | Complex | MathCollection | Unit>(
|
4831
|
+
this: MathJsChain<T>
|
4832
|
+
): MathJsChain<T>
|
4993
4833
|
|
4994
4834
|
/**
|
4995
4835
|
* Compute the square of a value, x * x. For matrices, the function is
|
4996
4836
|
* evaluated element wise.
|
4997
4837
|
*/
|
4998
4838
|
|
4999
|
-
square(this: MathJsChain<
|
5000
|
-
square(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
5001
|
-
square(this: MathJsChain<Fraction>): MathJsChain<Fraction>
|
5002
|
-
square(this: MathJsChain<Complex>): MathJsChain<Complex>
|
5003
|
-
square(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
5004
|
-
square(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
5005
|
-
square(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4839
|
+
square<T extends MathType>(this: MathJsChain<T>): MathJsChain<T>
|
5006
4840
|
|
5007
4841
|
/**
|
5008
4842
|
* Subtract two values, x - y. For matrices, the function is evaluated
|
@@ -5010,7 +4844,6 @@ declare namespace math {
|
|
5010
4844
|
* @param y Value to subtract from x
|
5011
4845
|
*/
|
5012
4846
|
subtract<T extends MathType>(this: MathJsChain<T>, y: T): MathJsChain<T>
|
5013
|
-
subtract(this: MathJsChain<MathType>, y: MathType): MathJsChain<MathType>
|
5014
4847
|
|
5015
4848
|
/**
|
5016
4849
|
* Inverse the sign of a value, apply a unary minus operation. For
|
@@ -5019,13 +4852,7 @@ declare namespace math {
|
|
5019
4852
|
* and complex value are inverted.
|
5020
4853
|
*/
|
5021
4854
|
|
5022
|
-
unaryMinus(this: MathJsChain<
|
5023
|
-
unaryMinus(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
5024
|
-
unaryMinus(this: MathJsChain<Fraction>): MathJsChain<Fraction>
|
5025
|
-
unaryMinus(this: MathJsChain<Complex>): MathJsChain<Complex>
|
5026
|
-
unaryMinus(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
5027
|
-
unaryMinus(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
5028
|
-
unaryMinus(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4855
|
+
unaryMinus<T extends MathType>(this: MathJsChain<T>): MathJsChain<T>
|
5029
4856
|
|
5030
4857
|
/**
|
5031
4858
|
* Unary plus operation. Boolean values and strings will be converted to
|
@@ -5033,14 +4860,7 @@ declare namespace math {
|
|
5033
4860
|
* function is evaluated element wise.
|
5034
4861
|
*/
|
5035
4862
|
|
5036
|
-
unaryPlus(this: MathJsChain<
|
5037
|
-
unaryPlus(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
5038
|
-
unaryPlus(this: MathJsChain<Fraction>): MathJsChain<Fraction>
|
5039
|
-
unaryPlus(this: MathJsChain<string>): MathJsChain<string>
|
5040
|
-
unaryPlus(this: MathJsChain<Complex>): MathJsChain<Complex>
|
5041
|
-
unaryPlus(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
5042
|
-
unaryPlus(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
5043
|
-
unaryPlus(this: MathJsChain<Unit>): MathJsChain<Unit>
|
4863
|
+
unaryPlus<T extends string | MathType>(this: MathJsChain<T>): MathJsChain<T>
|
5044
4864
|
|
5045
4865
|
/**
|
5046
4866
|
* Calculate the extended greatest common divisor for two values. See
|
@@ -5087,10 +4907,9 @@ declare namespace math {
|
|
5087
4907
|
* base.
|
5088
4908
|
*/
|
5089
4909
|
|
5090
|
-
bitNot
|
5091
|
-
|
5092
|
-
|
5093
|
-
bitNot(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
4910
|
+
bitNot<T extends number | BigNumber | MathCollection>(
|
4911
|
+
this: MathJsChain<T>
|
4912
|
+
): MathJsChain<T>
|
5094
4913
|
|
5095
4914
|
/**
|
5096
4915
|
* Bitwise OR two values, x | y. For matrices, the function is evaluated
|
@@ -5098,10 +4917,10 @@ declare namespace math {
|
|
5098
4917
|
* print base.
|
5099
4918
|
* @param y Second value to or
|
5100
4919
|
*/
|
5101
|
-
bitOr
|
5102
|
-
|
5103
|
-
|
5104
|
-
|
4920
|
+
bitOr<T extends number | BigNumber | MathCollection>(
|
4921
|
+
this: MathJsChain<T>,
|
4922
|
+
y: T
|
4923
|
+
): MathJsChain<T>
|
5105
4924
|
|
5106
4925
|
/**
|
5107
4926
|
* Bitwise XOR two values, x ^ y. For matrices, the function is
|
@@ -5270,7 +5089,7 @@ declare namespace math {
|
|
5270
5089
|
this: MathJsChain<MathCollection>,
|
5271
5090
|
x: MathCollection,
|
5272
5091
|
y: MathCollection,
|
5273
|
-
z
|
5092
|
+
z?: MathCollection
|
5274
5093
|
): MathJsChain<MathArray>
|
5275
5094
|
|
5276
5095
|
/*************************************************************************
|
@@ -5342,7 +5161,7 @@ declare namespace math {
|
|
5342
5161
|
cross(
|
5343
5162
|
this: MathJsChain<MathCollection>,
|
5344
5163
|
y: MathCollection
|
5345
|
-
): MathJsChain<
|
5164
|
+
): MathJsChain<MathCollection>
|
5346
5165
|
|
5347
5166
|
/**
|
5348
5167
|
* Calculate the determinant of a matrix.
|
@@ -5369,7 +5188,7 @@ declare namespace math {
|
|
5369
5188
|
this: MathJsChain<MathCollection>,
|
5370
5189
|
k: number | BigNumber,
|
5371
5190
|
format?: string
|
5372
|
-
): MathJsChain<
|
5191
|
+
): MathJsChain<MathCollection>
|
5373
5192
|
|
5374
5193
|
/**
|
5375
5194
|
* Calculate the dot product of two vectors. The dot product of A = [a1,
|
@@ -5398,7 +5217,7 @@ declare namespace math {
|
|
5398
5217
|
* https://en.wikipedia.org/wiki/Schur_decomposition
|
5399
5218
|
* @returns Object containing both matrix U and T of the Schur Decomposition A=UTU'
|
5400
5219
|
*/
|
5401
|
-
schur(this: MathJsChain<
|
5220
|
+
schur(this: MathJsChain<MathCollection>): SchurDecomposition
|
5402
5221
|
|
5403
5222
|
/**
|
5404
5223
|
* Solves the Continuous-time Lyapunov equation AP+PA'=Q for P, where Q is a positive semidefinite
|
@@ -5408,9 +5227,9 @@ declare namespace math {
|
|
5408
5227
|
* @returns Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q
|
5409
5228
|
*/
|
5410
5229
|
lyap(
|
5411
|
-
this: MathJsChain<
|
5412
|
-
Q:
|
5413
|
-
): MathJsChain<
|
5230
|
+
this: MathJsChain<MathCollection>,
|
5231
|
+
Q: MathCollection
|
5232
|
+
): MathJsChain<MathCollection>
|
5414
5233
|
|
5415
5234
|
/**
|
5416
5235
|
* Create a 2-dimensional identity matrix with size m x n or n x n. The
|
@@ -5418,9 +5237,9 @@ declare namespace math {
|
|
5418
5237
|
* @param format The Matrix storage format
|
5419
5238
|
*/
|
5420
5239
|
identity(
|
5421
|
-
this: MathJsChain<number | number[] |
|
5240
|
+
this: MathJsChain<number | number[] | MathCollection>,
|
5422
5241
|
format?: string
|
5423
|
-
): MathJsChain<
|
5242
|
+
): MathJsChain<MathCollection | number>
|
5424
5243
|
|
5425
5244
|
/**
|
5426
5245
|
* @param n The y dimension for the matrix
|
@@ -5430,23 +5249,23 @@ declare namespace math {
|
|
5430
5249
|
this: MathJsChain<number>,
|
5431
5250
|
n: number,
|
5432
5251
|
format?: string
|
5433
|
-
): MathJsChain<
|
5252
|
+
): MathJsChain<MathCollection | number>
|
5434
5253
|
|
5435
5254
|
/**
|
5436
5255
|
* Filter the items in an array or one dimensional matrix.
|
5437
5256
|
*/
|
5438
5257
|
filter(
|
5439
|
-
this: MathJsChain<
|
5258
|
+
this: MathJsChain<MathCollection | string[]>,
|
5440
5259
|
test:
|
5441
5260
|
| ((
|
5442
5261
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5443
5262
|
value: any,
|
5444
5263
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5445
5264
|
index: any,
|
5446
|
-
matrix:
|
5265
|
+
matrix: MathCollection | string[]
|
5447
5266
|
) => boolean)
|
5448
5267
|
| RegExp
|
5449
|
-
): MathJsChain<
|
5268
|
+
): MathJsChain<MathCollection>
|
5450
5269
|
|
5451
5270
|
/**
|
5452
5271
|
* Flatten a multi dimensional matrix into a single dimensional matrix.
|
@@ -5458,7 +5277,7 @@ declare namespace math {
|
|
5458
5277
|
* Iterate over all elements of a matrix/array, and executes the given
|
5459
5278
|
* callback function.
|
5460
5279
|
*/
|
5461
|
-
forEach<T extends
|
5280
|
+
forEach<T extends MathCollection>(
|
5462
5281
|
this: MathJsChain<T>,
|
5463
5282
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5464
5283
|
callback: (value: any, index: any, matrix: T) => void
|
@@ -5477,8 +5296,8 @@ declare namespace math {
|
|
5477
5296
|
* @param y Second vector
|
5478
5297
|
*/
|
5479
5298
|
kron(
|
5480
|
-
this: MathJsChain<
|
5481
|
-
y:
|
5299
|
+
this: MathJsChain<MathCollection>,
|
5300
|
+
y: MathCollection
|
5482
5301
|
): MathJsChain<Matrix>
|
5483
5302
|
|
5484
5303
|
/**
|
@@ -5488,7 +5307,7 @@ declare namespace math {
|
|
5488
5307
|
* parameters: the value of the element, the index of the element, and
|
5489
5308
|
* the Matrix/array being traversed.
|
5490
5309
|
*/
|
5491
|
-
map<T extends
|
5310
|
+
map<T extends MathCollection>(
|
5492
5311
|
this: MathJsChain<T>,
|
5493
5312
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5494
5313
|
callback: (value: any, index: any, matrix: T) => MathType | string
|
@@ -5578,7 +5397,7 @@ declare namespace math {
|
|
5578
5397
|
* is called as compare(a, b), and must return 1 when a > b, -1 when a <
|
5579
5398
|
* b, and 0 when a == b. Default value: ‘asc’
|
5580
5399
|
*/
|
5581
|
-
sort<T extends
|
5400
|
+
sort<T extends MathCollection>(
|
5582
5401
|
this: MathJsChain<T>,
|
5583
5402
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5584
5403
|
compare: ((a: any, b: any) => number) | 'asc' | 'desc' | 'natural'
|
@@ -5803,12 +5622,7 @@ declare namespace math {
|
|
5803
5622
|
* accepts both matrices and scalar values.
|
5804
5623
|
* @param y Second amtrix to compare
|
5805
5624
|
*/
|
5806
|
-
deepEqual(
|
5807
|
-
this: MathJsChain<MathType>,
|
5808
|
-
y: MathType
|
5809
|
-
): MathJsChain<
|
5810
|
-
number | BigNumber | Fraction | Complex | Unit | MathCollection
|
5811
|
-
>
|
5625
|
+
deepEqual(this: MathJsChain<MathType>, y: MathType): MathJsChain<MathType>
|
5812
5626
|
|
5813
5627
|
/**
|
5814
5628
|
* Test whether two values are equal.
|
@@ -5966,7 +5780,7 @@ declare namespace math {
|
|
5966
5780
|
* @param a A multiset
|
5967
5781
|
*/
|
5968
5782
|
setMultiplicity(
|
5969
|
-
e: MathJsChain<
|
5783
|
+
e: MathJsChain<MathNumericType>,
|
5970
5784
|
a: MathCollection
|
5971
5785
|
): MathJsChain<number>
|
5972
5786
|
|
@@ -6268,11 +6082,9 @@ declare namespace math {
|
|
6268
6082
|
* is evaluated element wise.
|
6269
6083
|
*/
|
6270
6084
|
|
6271
|
-
acos
|
6272
|
-
|
6273
|
-
|
6274
|
-
acos(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6275
|
-
acos(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6085
|
+
acos<T extends number | BigNumber | Complex | MathCollection>(
|
6086
|
+
this: MathJsChain<T>
|
6087
|
+
): MathJsChain<T>
|
6276
6088
|
|
6277
6089
|
/**
|
6278
6090
|
* Calculate the hyperbolic arccos of a value, defined as acosh(x) =
|
@@ -6280,21 +6092,18 @@ declare namespace math {
|
|
6280
6092
|
* element wise.
|
6281
6093
|
*/
|
6282
6094
|
|
6283
|
-
acosh
|
6284
|
-
|
6285
|
-
|
6286
|
-
acosh(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6287
|
-
acosh(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6095
|
+
acosh<T extends number | BigNumber | Complex | MathCollection>(
|
6096
|
+
this: MathJsChain<T>
|
6097
|
+
): MathJsChain<T>
|
6288
6098
|
|
6289
6099
|
/**
|
6290
6100
|
* Calculate the inverse cotangent of a value. For matrices, the
|
6291
6101
|
* function is evaluated element wise.
|
6292
6102
|
*/
|
6293
6103
|
|
6294
|
-
acot
|
6295
|
-
|
6296
|
-
|
6297
|
-
acot(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6104
|
+
acot<T extends number | BigNumber | Complex | MathCollection>(
|
6105
|
+
this: MathJsChain<T>
|
6106
|
+
): MathJsChain<T>
|
6298
6107
|
|
6299
6108
|
/**
|
6300
6109
|
* Calculate the hyperbolic arccotangent of a value, defined as acoth(x)
|
@@ -6302,20 +6111,18 @@ declare namespace math {
|
|
6302
6111
|
* evaluated element wise.
|
6303
6112
|
*/
|
6304
6113
|
|
6305
|
-
acoth
|
6306
|
-
|
6307
|
-
|
6308
|
-
acoth(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6114
|
+
acoth<T extends number | BigNumber | Complex | MathCollection>(
|
6115
|
+
this: MathJsChain<T>
|
6116
|
+
): MathJsChain<T>
|
6309
6117
|
|
6310
6118
|
/**
|
6311
6119
|
* Calculate the inverse cosecant of a value. For matrices, the function
|
6312
6120
|
* is evaluated element wise.
|
6313
6121
|
*/
|
6314
6122
|
|
6315
|
-
acsc
|
6316
|
-
|
6317
|
-
|
6318
|
-
acsc(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6123
|
+
acsc<T extends number | BigNumber | Complex | MathCollection>(
|
6124
|
+
this: MathJsChain<T>
|
6125
|
+
): MathJsChain<T>
|
6319
6126
|
|
6320
6127
|
/**
|
6321
6128
|
* Calculate the hyperbolic arccosecant of a value, defined as acsch(x)
|
@@ -6323,20 +6130,18 @@ declare namespace math {
|
|
6323
6130
|
* element wise.
|
6324
6131
|
*/
|
6325
6132
|
|
6326
|
-
acsch
|
6327
|
-
|
6328
|
-
|
6329
|
-
acsch(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6133
|
+
acsch<T extends number | BigNumber | Complex | MathCollection>(
|
6134
|
+
this: MathJsChain<T>
|
6135
|
+
): MathJsChain<T>
|
6330
6136
|
|
6331
6137
|
/**
|
6332
6138
|
* Calculate the inverse secant of a value. For matrices, the function
|
6333
6139
|
* is evaluated element wise.
|
6334
6140
|
*/
|
6335
6141
|
|
6336
|
-
asec
|
6337
|
-
|
6338
|
-
|
6339
|
-
asec(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6142
|
+
asec<T extends number | BigNumber | Complex | MathCollection>(
|
6143
|
+
this: MathJsChain<T>
|
6144
|
+
): MathJsChain<T>
|
6340
6145
|
|
6341
6146
|
/**
|
6342
6147
|
* Calculate the hyperbolic arcsecant of a value, defined as asech(x) =
|
@@ -6344,21 +6149,18 @@ declare namespace math {
|
|
6344
6149
|
* element wise.
|
6345
6150
|
*/
|
6346
6151
|
|
6347
|
-
asech
|
6348
|
-
|
6349
|
-
|
6350
|
-
asech(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6152
|
+
asech<T extends number | BigNumber | Complex | MathCollection>(
|
6153
|
+
this: MathJsChain<T>
|
6154
|
+
): MathJsChain<T>
|
6351
6155
|
|
6352
6156
|
/**
|
6353
6157
|
* Calculate the inverse sine of a value. For matrices, the function is
|
6354
6158
|
* evaluated element wise.
|
6355
6159
|
*/
|
6356
6160
|
|
6357
|
-
asin
|
6358
|
-
|
6359
|
-
|
6360
|
-
asin(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6361
|
-
asin(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6161
|
+
asin<T extends number | BigNumber | Complex | MathCollection>(
|
6162
|
+
this: MathJsChain<T>
|
6163
|
+
): MathJsChain<T>
|
6362
6164
|
|
6363
6165
|
/**
|
6364
6166
|
* Calculate the hyperbolic arcsine of a value, defined as asinh(x) =
|
@@ -6366,20 +6168,18 @@ declare namespace math {
|
|
6366
6168
|
* element wise.
|
6367
6169
|
*/
|
6368
6170
|
|
6369
|
-
asinh
|
6370
|
-
|
6371
|
-
|
6372
|
-
asinh(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6171
|
+
asinh<T extends number | BigNumber | Complex | MathCollection>(
|
6172
|
+
this: MathJsChain<T>
|
6173
|
+
): MathJsChain<T>
|
6373
6174
|
|
6374
6175
|
/**
|
6375
6176
|
* Calculate the inverse tangent of a value. For matrices, the function
|
6376
6177
|
* is evaluated element wise.
|
6377
6178
|
*/
|
6378
6179
|
|
6379
|
-
atan
|
6380
|
-
|
6381
|
-
|
6382
|
-
atan(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6180
|
+
atan<T extends number | BigNumber | Complex | MathCollection>(
|
6181
|
+
this: MathJsChain<T>
|
6182
|
+
): MathJsChain<T>
|
6383
6183
|
|
6384
6184
|
/**
|
6385
6185
|
* Calculate the inverse tangent function with two arguments, y/x. By
|
@@ -6387,11 +6187,10 @@ declare namespace math {
|
|
6387
6187
|
* be determined. For matrices, the function is evaluated element wise.
|
6388
6188
|
*/
|
6389
6189
|
|
6390
|
-
atan2
|
6391
|
-
|
6392
|
-
|
6393
|
-
|
6394
|
-
): MathJsChain<MathCollection>
|
6190
|
+
atan2<T extends number | BigNumber | Complex | MathCollection>(
|
6191
|
+
this: MathJsChain<T>,
|
6192
|
+
x: number
|
6193
|
+
): MathJsChain<T>
|
6395
6194
|
|
6396
6195
|
/**
|
6397
6196
|
* Calculate the hyperbolic arctangent of a value, defined as atanh(x) =
|
@@ -6399,21 +6198,18 @@ declare namespace math {
|
|
6399
6198
|
* element wise.
|
6400
6199
|
*/
|
6401
6200
|
|
6402
|
-
atanh
|
6403
|
-
|
6404
|
-
|
6405
|
-
atanh(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6201
|
+
atanh<T extends number | BigNumber | Complex | MathCollection>(
|
6202
|
+
this: MathJsChain<T>
|
6203
|
+
): MathJsChain<T>
|
6406
6204
|
|
6407
6205
|
/**
|
6408
6206
|
* Calculate the cosine of a value. For matrices, the function is
|
6409
6207
|
* evaluated element wise.
|
6410
6208
|
*/
|
6411
6209
|
|
6412
|
-
cos
|
6413
|
-
|
6414
|
-
|
6415
|
-
cos(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6416
|
-
cos(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6210
|
+
cos<T extends number | BigNumber | Complex | MathCollection>(
|
6211
|
+
this: MathJsChain<T>
|
6212
|
+
): MathJsChain<T>
|
6417
6213
|
|
6418
6214
|
/**
|
6419
6215
|
* Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2
|
@@ -6421,82 +6217,72 @@ declare namespace math {
|
|
6421
6217
|
* wise.
|
6422
6218
|
*/
|
6423
6219
|
|
6424
|
-
cosh
|
6425
|
-
|
6426
|
-
|
6427
|
-
cosh(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6428
|
-
cosh(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6220
|
+
cosh<T extends number | BigNumber | Complex | MathCollection>(
|
6221
|
+
this: MathJsChain<T>
|
6222
|
+
): MathJsChain<T>
|
6429
6223
|
|
6430
6224
|
/**
|
6431
6225
|
* Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x).
|
6432
6226
|
* For matrices, the function is evaluated element wise.
|
6433
6227
|
*/
|
6434
6228
|
|
6435
|
-
cot
|
6436
|
-
|
6437
|
-
|
6438
|
-
cot(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6229
|
+
cot<T extends number | BigNumber | Complex | MathCollection>(
|
6230
|
+
this: MathJsChain<T>
|
6231
|
+
): MathJsChain<T>
|
6439
6232
|
|
6440
6233
|
/**
|
6441
6234
|
* Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1
|
6442
6235
|
* / tanh(x). For matrices, the function is evaluated element wise.
|
6443
6236
|
*/
|
6444
6237
|
|
6445
|
-
coth
|
6446
|
-
|
6447
|
-
|
6448
|
-
coth(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6238
|
+
coth<T extends number | BigNumber | Complex | MathCollection>(
|
6239
|
+
this: MathJsChain<T>
|
6240
|
+
): MathJsChain<T>
|
6449
6241
|
|
6450
6242
|
/**
|
6451
6243
|
* Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For
|
6452
6244
|
* matrices, the function is evaluated element wise.
|
6453
6245
|
*/
|
6454
6246
|
|
6455
|
-
csc
|
6456
|
-
|
6457
|
-
|
6458
|
-
csc(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6247
|
+
csc<T extends number | BigNumber | Complex | MathCollection>(
|
6248
|
+
this: MathJsChain<T>
|
6249
|
+
): MathJsChain<T>
|
6459
6250
|
|
6460
6251
|
/**
|
6461
6252
|
* Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1
|
6462
6253
|
* / sinh(x). For matrices, the function is evaluated element wise.
|
6463
6254
|
*/
|
6464
6255
|
|
6465
|
-
csch
|
6466
|
-
|
6467
|
-
|
6468
|
-
csch(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6256
|
+
csch<T extends number | BigNumber | Complex | MathCollection>(
|
6257
|
+
this: MathJsChain<T>
|
6258
|
+
): MathJsChain<T>
|
6469
6259
|
|
6470
6260
|
/**
|
6471
6261
|
* Calculate the secant of a value, defined as sec(x) = 1/cos(x). For
|
6472
6262
|
* matrices, the function is evaluated element wise.
|
6473
6263
|
*/
|
6474
6264
|
|
6475
|
-
sec
|
6476
|
-
|
6477
|
-
|
6478
|
-
sec(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6265
|
+
sec<T extends number | BigNumber | Complex | MathCollection>(
|
6266
|
+
this: MathJsChain<T>
|
6267
|
+
): MathJsChain<T>
|
6479
6268
|
|
6480
6269
|
/**
|
6481
6270
|
* Calculate the hyperbolic secant of a value, defined as sech(x) = 1 /
|
6482
6271
|
* cosh(x). For matrices, the function is evaluated element wise.
|
6483
6272
|
*/
|
6484
6273
|
|
6485
|
-
sech
|
6486
|
-
|
6487
|
-
|
6488
|
-
sech(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6274
|
+
sech<T extends number | BigNumber | Complex | MathCollection>(
|
6275
|
+
this: MathJsChain<T>
|
6276
|
+
): MathJsChain<T>
|
6489
6277
|
|
6490
6278
|
/**
|
6491
6279
|
* Calculate the sine of a value. For matrices, the function is
|
6492
6280
|
* evaluated element wise.
|
6493
6281
|
*/
|
6494
6282
|
|
6495
|
-
sin
|
6496
|
-
|
6497
|
-
|
6498
|
-
sin(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6499
|
-
sin(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6283
|
+
sin<T extends number | BigNumber | Complex | MathCollection>(
|
6284
|
+
this: MathJsChain<T>
|
6285
|
+
): MathJsChain<T>
|
6500
6286
|
|
6501
6287
|
/**
|
6502
6288
|
* Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 *
|
@@ -6504,22 +6290,18 @@ declare namespace math {
|
|
6504
6290
|
* wise.
|
6505
6291
|
*/
|
6506
6292
|
|
6507
|
-
sinh
|
6508
|
-
|
6509
|
-
|
6510
|
-
sinh(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6511
|
-
sinh(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6293
|
+
sinh<T extends number | BigNumber | Complex | MathCollection>(
|
6294
|
+
this: MathJsChain<T>
|
6295
|
+
): MathJsChain<T>
|
6512
6296
|
|
6513
6297
|
/**
|
6514
6298
|
* Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x).
|
6515
6299
|
* For matrices, the function is evaluated element wise.
|
6516
6300
|
*/
|
6517
6301
|
|
6518
|
-
tan
|
6519
|
-
|
6520
|
-
|
6521
|
-
tan(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6522
|
-
tan(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6302
|
+
tan<T extends number | BigNumber | Complex | MathCollection>(
|
6303
|
+
this: MathJsChain<T>
|
6304
|
+
): MathJsChain<T>
|
6523
6305
|
|
6524
6306
|
/**
|
6525
6307
|
* Calculate the hyperbolic tangent of a value, defined as tanh(x) =
|
@@ -6527,11 +6309,9 @@ declare namespace math {
|
|
6527
6309
|
* evaluated element wise.
|
6528
6310
|
*/
|
6529
6311
|
|
6530
|
-
tanh
|
6531
|
-
|
6532
|
-
|
6533
|
-
tanh(this: MathJsChain<MathArray>): MathJsChain<MathArray>
|
6534
|
-
tanh(this: MathJsChain<Matrix>): MathJsChain<Matrix>
|
6312
|
+
tanh<T extends number | BigNumber | Complex | MathCollection>(
|
6313
|
+
this: MathJsChain<T>
|
6314
|
+
): MathJsChain<T>
|
6535
6315
|
|
6536
6316
|
/*************************************************************************
|
6537
6317
|
* Unit functions
|
@@ -6623,11 +6403,7 @@ declare namespace math {
|
|
6623
6403
|
* evaluated element-wise in case of Array or Matrix input.
|
6624
6404
|
*/
|
6625
6405
|
|
6626
|
-
isZero(
|
6627
|
-
this: MathJsChain<
|
6628
|
-
number | BigNumber | Fraction | MathCollection | Unit | Complex
|
6629
|
-
>
|
6630
|
-
): MathJsChain<boolean>
|
6406
|
+
isZero(this: MathJsChain<MathType>): MathJsChain<boolean>
|
6631
6407
|
|
6632
6408
|
/**
|
6633
6409
|
* Determine the type of a variable.
|