mathjs 10.5.2 → 10.6.1
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +28 -0
- package/lib/browser/math.js +6 -5
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js +41 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js +29 -0
- package/lib/cjs/entry/dependenciesAny.generated.js +16 -0
- package/lib/cjs/entry/impureFunctionsAny.generated.js +66 -64
- package/lib/cjs/entry/pureFunctionsAny.generated.js +189 -171
- package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +6 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/fft.js +15 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js +15 -0
- package/lib/cjs/factoriesAny.js +16 -0
- package/lib/cjs/function/algebra/derivative.js +1 -1
- package/lib/cjs/function/matrix/fft.js +128 -0
- package/lib/cjs/function/matrix/ifft.js +49 -0
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js +24 -0
- package/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js +16 -0
- package/lib/esm/entry/dependenciesAny.generated.js +2 -0
- package/lib/esm/entry/impureFunctionsAny.generated.js +63 -61
- package/lib/esm/entry/pureFunctionsAny.generated.js +161 -145
- package/lib/esm/expression/embeddedDocs/embeddedDocs.js +4 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/fft.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/ifft.js +8 -0
- package/lib/esm/factoriesAny.js +2 -0
- package/lib/esm/function/algebra/derivative.js +1 -1
- package/lib/esm/function/matrix/fft.js +104 -0
- package/lib/esm/function/matrix/ifft.js +38 -0
- package/lib/esm/version.js +1 -1
- package/package.json +22 -24
- package/types/index.d.ts +1052 -283
- package/types/index.ts +711 -7
- package/docs/command_line_interface.md +0 -87
- package/docs/core/chaining.md +0 -41
- package/docs/core/configuration.md +0 -144
- package/docs/core/extension.md +0 -263
- package/docs/core/index.md +0 -21
- package/docs/core/serialization.md +0 -50
- package/docs/custom_bundling.md +0 -116
- package/docs/datatypes/bignumbers.md +0 -102
- package/docs/datatypes/complex_numbers.md +0 -168
- package/docs/datatypes/fractions.md +0 -75
- package/docs/datatypes/index.md +0 -67
- package/docs/datatypes/matrices.md +0 -375
- package/docs/datatypes/numbers.md +0 -106
- package/docs/datatypes/units.md +0 -444
- package/docs/expressions/algebra.md +0 -110
- package/docs/expressions/customization.md +0 -379
- package/docs/expressions/expression_trees.md +0 -710
- package/docs/expressions/html_classes.md +0 -38
- package/docs/expressions/index.md +0 -21
- package/docs/expressions/parsing.md +0 -224
- package/docs/expressions/security.md +0 -89
- package/docs/expressions/syntax.md +0 -706
- package/docs/getting_started.md +0 -124
- package/docs/index.md +0 -39
- package/docs/reference/classes/densematrix.md +0 -247
- package/docs/reference/classes/fibonacciheap.md +0 -70
- package/docs/reference/classes/matrixindex.md +0 -133
- package/docs/reference/classes/matrixrange.md +0 -158
- package/docs/reference/classes/resultset.md +0 -47
- package/docs/reference/classes/sparsematrix.md +0 -245
- package/docs/reference/classes/unit.md +0 -242
- package/docs/reference/classes.md +0 -86
- package/docs/reference/constants.md +0 -29
- package/docs/reference/functions/abs.md +0 -46
- package/docs/reference/functions/acos.md +0 -49
- package/docs/reference/functions/acosh.md +0 -47
- package/docs/reference/functions/acot.md +0 -48
- package/docs/reference/functions/acoth.md +0 -46
- package/docs/reference/functions/acsc.md +0 -49
- package/docs/reference/functions/acsch.md +0 -46
- package/docs/reference/functions/add.md +0 -59
- package/docs/reference/functions/and.md +0 -53
- package/docs/reference/functions/apply.md +0 -56
- package/docs/reference/functions/arg.md +0 -53
- package/docs/reference/functions/asec.md +0 -49
- package/docs/reference/functions/asech.md +0 -46
- package/docs/reference/functions/asin.md +0 -49
- package/docs/reference/functions/asinh.md +0 -46
- package/docs/reference/functions/atan.md +0 -49
- package/docs/reference/functions/atan2.md +0 -56
- package/docs/reference/functions/atanh.md +0 -46
- package/docs/reference/functions/bellNumbers.md +0 -45
- package/docs/reference/functions/bignumber.md +0 -47
- package/docs/reference/functions/bin.md +0 -45
- package/docs/reference/functions/bitAnd.md +0 -51
- package/docs/reference/functions/bitNot.md +0 -51
- package/docs/reference/functions/bitOr.md +0 -52
- package/docs/reference/functions/bitXor.md +0 -51
- package/docs/reference/functions/boolean.md +0 -50
- package/docs/reference/functions/catalan.md +0 -45
- package/docs/reference/functions/cbrt.md +0 -60
- package/docs/reference/functions/ceil.md +0 -63
- package/docs/reference/functions/chain.md +0 -54
- package/docs/reference/functions/clone.md +0 -43
- package/docs/reference/functions/column.md +0 -45
- package/docs/reference/functions/combinations.md +0 -49
- package/docs/reference/functions/combinationsWithRep.md +0 -49
- package/docs/reference/functions/compare.md +0 -67
- package/docs/reference/functions/compareNatural.md +0 -92
- package/docs/reference/functions/compareText.md +0 -54
- package/docs/reference/functions/compile.md +0 -56
- package/docs/reference/functions/complex.md +0 -17
- package/docs/reference/functions/composition.md +0 -46
- package/docs/reference/functions/concat.md +0 -56
- package/docs/reference/functions/config.md +0 -44
- package/docs/reference/functions/conj.md +0 -50
- package/docs/reference/functions/cos.md +0 -51
- package/docs/reference/functions/cosh.md +0 -46
- package/docs/reference/functions/cot.md +0 -47
- package/docs/reference/functions/coth.md +0 -49
- package/docs/reference/functions/count.md +0 -45
- package/docs/reference/functions/createUnit.md +0 -52
- package/docs/reference/functions/cross.md +0 -58
- package/docs/reference/functions/csc.md +0 -47
- package/docs/reference/functions/csch.md +0 -49
- package/docs/reference/functions/ctranspose.md +0 -50
- package/docs/reference/functions/cube.md +0 -51
- package/docs/reference/functions/cumsum.md +0 -57
- package/docs/reference/functions/deepEqual.md +0 -53
- package/docs/reference/functions/derivative.md +0 -61
- package/docs/reference/functions/det.md +0 -49
- package/docs/reference/functions/diag.md +0 -61
- package/docs/reference/functions/diff.md +0 -70
- package/docs/reference/functions/distance.md +0 -80
- package/docs/reference/functions/divide.md +0 -55
- package/docs/reference/functions/dot.md +0 -48
- package/docs/reference/functions/dotDivide.md +0 -52
- package/docs/reference/functions/dotMultiply.md +0 -52
- package/docs/reference/functions/dotPow.md +0 -49
- package/docs/reference/functions/eigs.md +0 -54
- package/docs/reference/functions/equal.md +0 -75
- package/docs/reference/functions/equalText.md +0 -53
- package/docs/reference/functions/erf.md +0 -49
- package/docs/reference/functions/evaluate.md +0 -56
- package/docs/reference/functions/exp.md +0 -54
- package/docs/reference/functions/expm.md +0 -49
- package/docs/reference/functions/expm1.md +0 -54
- package/docs/reference/functions/factorial.md +0 -49
- package/docs/reference/functions/fft.md +0 -35
- package/docs/reference/functions/filter.md +0 -50
- package/docs/reference/functions/fix.md +0 -62
- package/docs/reference/functions/flatten.md +0 -46
- package/docs/reference/functions/floor.md +0 -66
- package/docs/reference/functions/forEach.md +0 -41
- package/docs/reference/functions/format.md +0 -127
- package/docs/reference/functions/fraction.md +0 -45
- package/docs/reference/functions/gamma.md +0 -49
- package/docs/reference/functions/gcd.md +0 -50
- package/docs/reference/functions/getMatrixDataType.md +0 -59
- package/docs/reference/functions/hasNumericValue.md +0 -55
- package/docs/reference/functions/help.md +0 -42
- package/docs/reference/functions/hex.md +0 -45
- package/docs/reference/functions/hypot.md +0 -51
- package/docs/reference/functions/identity.md +0 -57
- package/docs/reference/functions/ifft.md +0 -35
- package/docs/reference/functions/im.md +0 -53
- package/docs/reference/functions/import.md +0 -68
- package/docs/reference/functions/index.md +0 -55
- package/docs/reference/functions/intersect.md +0 -50
- package/docs/reference/functions/inv.md +0 -45
- package/docs/reference/functions/invmod.md +0 -47
- package/docs/reference/functions/isInteger.md +0 -55
- package/docs/reference/functions/isNaN.md +0 -56
- package/docs/reference/functions/isNegative.md +0 -55
- package/docs/reference/functions/isNumeric.md +0 -55
- package/docs/reference/functions/isPositive.md +0 -57
- package/docs/reference/functions/isPrime.md +0 -54
- package/docs/reference/functions/isZero.md +0 -59
- package/docs/reference/functions/kldivergence.md +0 -41
- package/docs/reference/functions/kron.md +0 -53
- package/docs/reference/functions/larger.md +0 -60
- package/docs/reference/functions/largerEq.md +0 -56
- package/docs/reference/functions/lcm.md +0 -54
- package/docs/reference/functions/leafCount.md +0 -52
- package/docs/reference/functions/leftShift.md +0 -52
- package/docs/reference/functions/lgamma.md +0 -46
- package/docs/reference/functions/log.md +0 -57
- package/docs/reference/functions/log10.md +0 -50
- package/docs/reference/functions/log1p.md +0 -54
- package/docs/reference/functions/log2.md +0 -50
- package/docs/reference/functions/lsolve.md +0 -51
- package/docs/reference/functions/lsolveAll.md +0 -51
- package/docs/reference/functions/lup.md +0 -52
- package/docs/reference/functions/lusolve.md +0 -59
- package/docs/reference/functions/mad.md +0 -50
- package/docs/reference/functions/map.md +0 -65
- package/docs/reference/functions/matrix.md +0 -56
- package/docs/reference/functions/matrixFromColumns.md +0 -49
- package/docs/reference/functions/matrixFromFunction.md +0 -54
- package/docs/reference/functions/matrixFromRows.md +0 -49
- package/docs/reference/functions/max.md +0 -61
- package/docs/reference/functions/mean.md +0 -57
- package/docs/reference/functions/median.md +0 -57
- package/docs/reference/functions/min.md +0 -61
- package/docs/reference/functions/mod.md +0 -59
- package/docs/reference/functions/mode.md +0 -50
- package/docs/reference/functions/multinomial.md +0 -46
- package/docs/reference/functions/multiply.md +0 -60
- package/docs/reference/functions/norm.md +0 -59
- package/docs/reference/functions/not.md +0 -50
- package/docs/reference/functions/nthRoot.md +0 -53
- package/docs/reference/functions/nthRoots.md +0 -58
- package/docs/reference/functions/number.md +0 -49
- package/docs/reference/functions/numeric.md +0 -52
- package/docs/reference/functions/oct.md +0 -45
- package/docs/reference/functions/ones.md +0 -59
- package/docs/reference/functions/or.md +0 -53
- package/docs/reference/functions/parse.md +0 -56
- package/docs/reference/functions/parser.md +0 -70
- package/docs/reference/functions/partitionSelect.md +0 -53
- package/docs/reference/functions/permutations.md +0 -51
- package/docs/reference/functions/pickRandom.md +0 -59
- package/docs/reference/functions/pinv.md +0 -44
- package/docs/reference/functions/pow.md +0 -65
- package/docs/reference/functions/print.md +0 -64
- package/docs/reference/functions/prod.md +0 -55
- package/docs/reference/functions/qr.md +0 -65
- package/docs/reference/functions/quantileSeq.md +0 -62
- package/docs/reference/functions/random.md +0 -54
- package/docs/reference/functions/randomInt.md +0 -53
- package/docs/reference/functions/range.md +0 -70
- package/docs/reference/functions/rationalize.md +0 -68
- package/docs/reference/functions/re.md +0 -53
- package/docs/reference/functions/reshape.md +0 -60
- package/docs/reference/functions/resize.md +0 -51
- package/docs/reference/functions/resolve.md +0 -46
- package/docs/reference/functions/rightArithShift.md +0 -52
- package/docs/reference/functions/rightLogShift.md +0 -52
- package/docs/reference/functions/rotate.md +0 -53
- package/docs/reference/functions/rotationMatrix.md +0 -57
- package/docs/reference/functions/round.md +0 -61
- package/docs/reference/functions/row.md +0 -45
- package/docs/reference/functions/sec.md +0 -47
- package/docs/reference/functions/sech.md +0 -49
- package/docs/reference/functions/setCartesian.md +0 -49
- package/docs/reference/functions/setDifference.md +0 -47
- package/docs/reference/functions/setDistinct.md +0 -43
- package/docs/reference/functions/setIntersect.md +0 -46
- package/docs/reference/functions/setIsSubset.md +0 -47
- package/docs/reference/functions/setMultiplicity.md +0 -46
- package/docs/reference/functions/setPowerset.md +0 -43
- package/docs/reference/functions/setSize.md +0 -47
- package/docs/reference/functions/setSymDifference.md +0 -47
- package/docs/reference/functions/setUnion.md +0 -46
- package/docs/reference/functions/sign.md +0 -52
- package/docs/reference/functions/simplify.md +0 -130
- package/docs/reference/functions/simplifyConstant.md +0 -52
- package/docs/reference/functions/simplifyCore.md +0 -50
- package/docs/reference/functions/sin.md +0 -51
- package/docs/reference/functions/sinh.md +0 -46
- package/docs/reference/functions/size.md +0 -50
- package/docs/reference/functions/slu.md +0 -57
- package/docs/reference/functions/smaller.md +0 -60
- package/docs/reference/functions/smallerEq.md +0 -56
- package/docs/reference/functions/sort.md +0 -56
- package/docs/reference/functions/sparse.md +0 -51
- package/docs/reference/functions/splitUnit.md +0 -37
- package/docs/reference/functions/sqrt.md +0 -50
- package/docs/reference/functions/sqrtm.md +0 -46
- package/docs/reference/functions/square.md +0 -51
- package/docs/reference/functions/squeeze.md +0 -53
- package/docs/reference/functions/std.md +0 -76
- package/docs/reference/functions/stirlingS2.md +0 -52
- package/docs/reference/functions/string.md +0 -49
- package/docs/reference/functions/subset.md +0 -65
- package/docs/reference/functions/subtract.md +0 -54
- package/docs/reference/functions/sum.md +0 -54
- package/docs/reference/functions/symbolicEqual.md +0 -62
- package/docs/reference/functions/tan.md +0 -49
- package/docs/reference/functions/tanh.md +0 -50
- package/docs/reference/functions/to.md +0 -47
- package/docs/reference/functions/trace.md +0 -50
- package/docs/reference/functions/transpose.md +0 -49
- package/docs/reference/functions/typeOf.md +0 -81
- package/docs/reference/functions/typed.md +0 -56
- package/docs/reference/functions/unaryMinus.md +0 -49
- package/docs/reference/functions/unaryPlus.md +0 -48
- package/docs/reference/functions/unequal.md +0 -74
- package/docs/reference/functions/unit.md +0 -48
- package/docs/reference/functions/usolve.md +0 -51
- package/docs/reference/functions/usolveAll.md +0 -51
- package/docs/reference/functions/variance.md +0 -78
- package/docs/reference/functions/xgcd.md +0 -47
- package/docs/reference/functions/xor.md +0 -53
- package/docs/reference/functions/zeros.md +0 -57
- package/docs/reference/functions.md +0 -297
- package/docs/reference/index.md +0 -5
- package/examples/advanced/convert_fraction_to_bignumber.js +0 -59
- package/examples/advanced/custom_argument_parsing.js +0 -98
- package/examples/advanced/custom_datatype.js +0 -56
- package/examples/advanced/custom_evaluate_using_factories.js +0 -19
- package/examples/advanced/custom_evaluate_using_import.js +0 -18
- package/examples/advanced/custom_loading.js +0 -33
- package/examples/advanced/custom_relational_functions.js +0 -62
- package/examples/advanced/custom_scope_objects.js +0 -115
- package/examples/advanced/expression_trees.js +0 -55
- package/examples/advanced/function_transform.js +0 -50
- package/examples/advanced/more_secure_eval.js +0 -36
- package/examples/advanced/use_bigint.js +0 -43
- package/examples/advanced/web_server/math_worker.js +0 -24
- package/examples/advanced/web_server/server.js +0 -80
- package/examples/algebra.js +0 -34
- package/examples/basic_usage.js +0 -49
- package/examples/bignumbers.js +0 -52
- package/examples/browser/angle_configuration.html +0 -134
- package/examples/browser/basic_usage.html +0 -39
- package/examples/browser/currency_conversion.html +0 -125
- package/examples/browser/custom_separators.html +0 -81
- package/examples/browser/plot.html +0 -78
- package/examples/browser/pretty_printing_with_mathjax.html +0 -122
- package/examples/browser/printing_html.html +0 -170
- package/examples/browser/requirejs_loading.html +0 -20
- package/examples/browser/rocket_trajectory_optimization.html +0 -301
- package/examples/browser/webworkers/webworkers.html +0 -80
- package/examples/browser/webworkers/worker.js +0 -28
- package/examples/chaining.js +0 -56
- package/examples/complex_numbers.js +0 -67
- package/examples/expressions.js +0 -188
- package/examples/fractions.js +0 -74
- package/examples/import.js +0 -95
- package/examples/matrices.js +0 -101
- package/examples/objects.js +0 -35
- package/examples/package.json +0 -3
- package/examples/serialization.js +0 -16
- package/examples/sparse_matrices.js +0 -19
- package/examples/units.js +0 -108
@@ -1,242 +0,0 @@
|
|
1
|
-
<a name="Unit"></a>
|
2
|
-
## Unit
|
3
|
-
* [new Unit([value], [name])](#new_Unit_new)
|
4
|
-
* _instance_
|
5
|
-
* [.valueOf](#Unit+valueOf) ⇒ <code>string</code>
|
6
|
-
* [.clone()](#Unit+clone) ⇒ <code>Unit</code>
|
7
|
-
* [._isDerived()](#Unit+_isDerived) ⇒ <code>boolean</code>
|
8
|
-
* [.hasBase(base)](#Unit+hasBase)
|
9
|
-
* [.equalBase(other)](#Unit+equalBase) ⇒ <code>boolean</code>
|
10
|
-
* [.equals(other)](#Unit+equals) ⇒ <code>boolean</code>
|
11
|
-
* [.multiply(other)](#Unit+multiply) ⇒ <code>Unit</code>
|
12
|
-
* [.divide(other)](#Unit+divide) ⇒ <code>Unit</code>
|
13
|
-
* [.pow(p)](#Unit+pow) ⇒ <code>Unit</code>
|
14
|
-
* [.abs(x)](#Unit+abs) ⇒ <code>Unit</code>
|
15
|
-
* [.to(valuelessUnit)](#Unit+to) ⇒ <code>Unit</code>
|
16
|
-
* [.toNumber(valuelessUnit)](#Unit+toNumber) ⇒ <code>number</code>
|
17
|
-
* [.toNumeric(valuelessUnit)](#Unit+toNumeric) ⇒ <code>number</code> | <code>BigNumber</code> | <code>Fraction</code>
|
18
|
-
* [.toString()](#Unit+toString) ⇒ <code>string</code>
|
19
|
-
* [.toJSON()](#Unit+toJSON) ⇒ <code>Object</code>
|
20
|
-
* [.formatUnits()](#Unit+formatUnits) ⇒ <code>string</code>
|
21
|
-
* [.format([options])](#Unit+format) ⇒ <code>string</code>
|
22
|
-
* _static_
|
23
|
-
* [.parse(str)](#Unit.parse) ⇒ <code>Unit</code>
|
24
|
-
* [.isValuelessUnit(name)](#Unit.isValuelessUnit) ⇒ <code>boolean</code>
|
25
|
-
* [.fromJSON(json)](#Unit.fromJSON) ⇒ <code>Unit</code>
|
26
|
-
|
27
|
-
<a name="new_Unit_new"></a>
|
28
|
-
### new Unit([value], [name])
|
29
|
-
A unit can be constructed in the following ways:
|
30
|
-
|
31
|
-
```js
|
32
|
-
const a = new Unit(value, name)
|
33
|
-
const b = new Unit(null, name)
|
34
|
-
const c = Unit.parse(str)
|
35
|
-
```
|
36
|
-
|
37
|
-
Example usage:
|
38
|
-
|
39
|
-
```js
|
40
|
-
const a = new Unit(5, 'cm') // 50 mm
|
41
|
-
const b = Unit.parse('23 kg') // 23 kg
|
42
|
-
const c = math.in(a, new Unit(null, 'm') // 0.05 m
|
43
|
-
const d = new Unit(9.81, "m/s^2") // 9.81 m/s^2
|
44
|
-
```
|
45
|
-
|
46
|
-
| Param | Type | Description |
|
47
|
-
| --- | --- | --- |
|
48
|
-
| [value] | <code>number</code> | <code>BigNumber</code> | <code>Fraction</code> | <code>Complex</code> | <code>boolean</code> | A value like 5.2 |
|
49
|
-
| [name] | <code>string</code> | A unit name like "cm" or "inch", or a derived unit of the form: "u1[^ex1] [u2[^ex2] ...] [/ u3[^ex3] [u4[^ex4]]]", such as "kg m^2/s^2", where each unit appearing after the forward slash is taken to be in the denominator. "kg m^2 s^-2" is a synonym and is also acceptable. Any of the units can include a prefix. |
|
50
|
-
|
51
|
-
<a name="Unit+valueOf"></a>
|
52
|
-
### unit.valueOf ⇒ <code>string</code>
|
53
|
-
Returns the string representation of the unit.
|
54
|
-
|
55
|
-
**Kind**: instance property of <code>Unit</code>
|
56
|
-
<a name="Unit+clone"></a>
|
57
|
-
### unit.clone() ⇒ <code>Unit</code>
|
58
|
-
create a copy of this unit
|
59
|
-
|
60
|
-
**Kind**: instance method of <code>Unit</code>
|
61
|
-
**Returns**: <code>Unit</code> - Returns a cloned version of the unit
|
62
|
-
<a name="Unit+_isDerived"></a>
|
63
|
-
### unit._isDerived() ⇒ <code>boolean</code>
|
64
|
-
Return whether the unit is derived (such as m/s, or cm^2, but not N)
|
65
|
-
|
66
|
-
**Kind**: instance method of <code>Unit</code>
|
67
|
-
**Returns**: <code>boolean</code> - True if the unit is derived
|
68
|
-
<a name="Unit+hasBase"></a>
|
69
|
-
### unit.hasBase(base)
|
70
|
-
check if this unit has given base unit
|
71
|
-
If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived.
|
72
|
-
|
73
|
-
**Kind**: instance method of <code>Unit</code>
|
74
|
-
|
75
|
-
| Param | Type |
|
76
|
-
| --- | --- |
|
77
|
-
| base | <code>BASE_UNITS</code> | <code>STRING</code> | <code>undefined</code> |
|
78
|
-
|
79
|
-
<a name="Unit+equalBase"></a>
|
80
|
-
### unit.equalBase(other) ⇒ <code>boolean</code>
|
81
|
-
Check if this unit has a base or bases equal to another base or bases
|
82
|
-
For derived units, the exponent on each base also must match
|
83
|
-
|
84
|
-
**Kind**: instance method of <code>Unit</code>
|
85
|
-
**Returns**: <code>boolean</code> - true if equal base
|
86
|
-
|
87
|
-
| Param | Type |
|
88
|
-
| --- | --- |
|
89
|
-
| other | <code>Unit</code> |
|
90
|
-
|
91
|
-
<a name="Unit+equals"></a>
|
92
|
-
### unit.equals(other) ⇒ <code>boolean</code>
|
93
|
-
Check if this unit equals another unit
|
94
|
-
|
95
|
-
**Kind**: instance method of <code>Unit</code>
|
96
|
-
**Returns**: <code>boolean</code> - true if both units are equal
|
97
|
-
|
98
|
-
| Param | Type |
|
99
|
-
| --- | --- |
|
100
|
-
| other | <code>Unit</code> |
|
101
|
-
|
102
|
-
<a name="Unit+multiply"></a>
|
103
|
-
### unit.multiply(other) ⇒ <code>Unit</code>
|
104
|
-
Multiply this unit with another one
|
105
|
-
|
106
|
-
**Kind**: instance method of <code>Unit</code>
|
107
|
-
**Returns**: <code>Unit</code> - product of this unit and the other unit
|
108
|
-
|
109
|
-
| Param | Type |
|
110
|
-
| --- | --- |
|
111
|
-
| other | <code>Unit</code> |
|
112
|
-
|
113
|
-
<a name="Unit+divide"></a>
|
114
|
-
### unit.divide(other) ⇒ <code>Unit</code>
|
115
|
-
Divide this unit by another one
|
116
|
-
|
117
|
-
**Kind**: instance method of <code>Unit</code>
|
118
|
-
**Returns**: <code>Unit</code> - result of dividing this unit by the other unit
|
119
|
-
|
120
|
-
| Param | Type |
|
121
|
-
| --- | --- |
|
122
|
-
| other | <code>Unit</code> |
|
123
|
-
|
124
|
-
<a name="Unit+pow"></a>
|
125
|
-
### unit.pow(p) ⇒ <code>Unit</code>
|
126
|
-
Calculate the power of a unit
|
127
|
-
|
128
|
-
**Kind**: instance method of <code>Unit</code>
|
129
|
-
**Returns**: <code>Unit</code> - The result: this^p
|
130
|
-
|
131
|
-
| Param | Type |
|
132
|
-
| --- | --- |
|
133
|
-
| p | <code>number</code> | <code>Fraction</code> | <code>BigNumber</code> |
|
134
|
-
|
135
|
-
<a name="Unit+abs"></a>
|
136
|
-
### unit.abs(x) ⇒ <code>Unit</code>
|
137
|
-
Calculate the absolute value of a unit
|
138
|
-
|
139
|
-
**Kind**: instance method of <code>Unit</code>
|
140
|
-
**Returns**: <code>Unit</code> - The result: |x|, absolute value of x
|
141
|
-
|
142
|
-
| Param | Type |
|
143
|
-
| --- | --- |
|
144
|
-
| x | <code>number</code> | <code>Fraction</code> | <code>BigNumber</code> |
|
145
|
-
|
146
|
-
<a name="Unit+to"></a>
|
147
|
-
### unit.to(valuelessUnit) ⇒ <code>Unit</code>
|
148
|
-
Convert the unit to a specific unit name.
|
149
|
-
|
150
|
-
**Kind**: instance method of <code>Unit</code>
|
151
|
-
**Returns**: <code>Unit</code> - Returns a clone of the unit with a fixed prefix and unit.
|
152
|
-
|
153
|
-
| Param | Type | Description |
|
154
|
-
| --- | --- | --- |
|
155
|
-
| valuelessUnit | <code>string</code> | <code>Unit</code> | A unit without value. Can have prefix, like "cm" |
|
156
|
-
|
157
|
-
<a name="Unit+toNumber"></a>
|
158
|
-
### unit.toNumber(valuelessUnit) ⇒ <code>number</code>
|
159
|
-
Return the value of the unit when represented with given valueless unit
|
160
|
-
|
161
|
-
**Kind**: instance method of <code>Unit</code>
|
162
|
-
**Returns**: <code>number</code> - Returns the unit value as number.
|
163
|
-
|
164
|
-
| Param | Type | Description |
|
165
|
-
| --- | --- | --- |
|
166
|
-
| valuelessUnit | <code>string</code> | <code>Unit</code> | For example 'cm' or 'inch' |
|
167
|
-
|
168
|
-
<a name="Unit+toNumeric"></a>
|
169
|
-
### unit.toNumeric(valuelessUnit) ⇒ <code>number</code> | <code>BigNumber</code> | <code>Fraction</code>
|
170
|
-
Return the value of the unit in the original numeric type
|
171
|
-
|
172
|
-
**Kind**: instance method of <code>Unit</code>
|
173
|
-
**Returns**: <code>number</code> | <code>BigNumber</code> | <code>Fraction</code> - Returns the unit value
|
174
|
-
|
175
|
-
| Param | Type | Description |
|
176
|
-
| --- | --- | --- |
|
177
|
-
| valuelessUnit | <code>string</code> | <code>Unit</code> | For example 'cm' or 'inch' |
|
178
|
-
|
179
|
-
<a name="Unit+toString"></a>
|
180
|
-
### unit.toString() ⇒ <code>string</code>
|
181
|
-
Get a string representation of the unit.
|
182
|
-
|
183
|
-
**Kind**: instance method of <code>Unit</code>
|
184
|
-
<a name="Unit+toJSON"></a>
|
185
|
-
### unit.toJSON() ⇒ <code>Object</code>
|
186
|
-
Get a JSON representation of the unit
|
187
|
-
|
188
|
-
**Kind**: instance method of <code>Unit</code>
|
189
|
-
**Returns**: <code>Object</code> - Returns a JSON object structured as:
|
190
|
-
`{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}`
|
191
|
-
<a name="Unit+formatUnits"></a>
|
192
|
-
### unit.formatUnits() ⇒ <code>string</code>
|
193
|
-
Get a string representation of the units of this Unit, without the value.
|
194
|
-
|
195
|
-
**Kind**: instance method of <code>Unit</code>
|
196
|
-
<a name="Unit+format"></a>
|
197
|
-
### unit.format([options]) ⇒ <code>string</code>
|
198
|
-
Get a string representation of the Unit, with optional formatting options.
|
199
|
-
|
200
|
-
**Kind**: instance method of <code>Unit</code>
|
201
|
-
|
202
|
-
| Param | Type | Description |
|
203
|
-
| --- | --- | --- |
|
204
|
-
| [options] | <code>Object</code> | <code>number</code> | <code>function</code> | Formatting options. See lib/utils/number:format for a description of the available options. |
|
205
|
-
|
206
|
-
<a name="Unit.parse"></a>
|
207
|
-
### Unit.parse(str) ⇒ <code>Unit</code>
|
208
|
-
Parse a string into a unit. The value of the unit is parsed as number,
|
209
|
-
BigNumber, or Fraction depending on the math.js config setting `number`.
|
210
|
-
|
211
|
-
Throws an exception if the provided string does not contain a valid unit or
|
212
|
-
cannot be parsed.
|
213
|
-
|
214
|
-
**Kind**: static method of <code>Unit</code>
|
215
|
-
**Returns**: <code>Unit</code> - unit
|
216
|
-
|
217
|
-
| Param | Type | Description |
|
218
|
-
| --- | --- | --- |
|
219
|
-
| str | <code>string</code> | A string like "5.2 inch", "4e2 cm/s^2" |
|
220
|
-
|
221
|
-
<a name="Unit.isValuelessUnit"></a>
|
222
|
-
### Unit.isValuelessUnit(name) ⇒ <code>boolean</code>
|
223
|
-
Test if the given expression is a unit.
|
224
|
-
The unit can have a prefix but cannot have a value.
|
225
|
-
|
226
|
-
**Kind**: static method of <code>Unit</code>
|
227
|
-
**Returns**: <code>boolean</code> - true if the given string is a unit
|
228
|
-
|
229
|
-
| Param | Type | Description |
|
230
|
-
| --- | --- | --- |
|
231
|
-
| name | <code>string</code> | A string to be tested whether it is a value less unit. The unit can have prefix, like "cm" |
|
232
|
-
|
233
|
-
<a name="Unit.fromJSON"></a>
|
234
|
-
### Unit.fromJSON(json) ⇒ <code>Unit</code>
|
235
|
-
Instantiate a Unit from a JSON object
|
236
|
-
|
237
|
-
**Kind**: static method of <code>Unit</code>
|
238
|
-
|
239
|
-
| Param | Type | Description |
|
240
|
-
| --- | --- | --- |
|
241
|
-
| json | <code>Object</code> | A JSON object structured as: `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}` |
|
242
|
-
|
@@ -1,86 +0,0 @@
|
|
1
|
-
|
2
|
-
# Class Reference
|
3
|
-
|
4
|
-
This page lists all the various class types in Math.js. Every top-level function is listed here and links to its detailed reference to other parts of the documentation.
|
5
|
-
|
6
|
-
## math
|
7
|
-
|
8
|
-
The "math" namespace contains the entire math.js functionality. All of the mathematical functions are available in the "math" namespace, and allow for inputs of various types.
|
9
|
-
|
10
|
-
- [Function reference](functions.md)
|
11
|
-
- [Constant reference](constants.md)
|
12
|
-
|
13
|
-
|
14
|
-
## Unit
|
15
|
-
|
16
|
-
Stores values for a scalar unit and its postfix. (eg `100 mm` or `100 kg`). Although the `Unit` class contains public functions documented as follows, using the following API directly is *not* recommended. Prefer using the functions in the "math" namespace wherever possible.
|
17
|
-
|
18
|
-
- [Overview](../datatypes/units.md)
|
19
|
-
- [Class API](classes/unit.md)
|
20
|
-
|
21
|
-
|
22
|
-
## Fraction
|
23
|
-
|
24
|
-
Stores values for a fractional number.
|
25
|
-
|
26
|
-
- [Overview](../datatypes/fractions.md)
|
27
|
-
- [Class API](https://github.com/infusion/Fraction.js/)
|
28
|
-
|
29
|
-
## BigNumber
|
30
|
-
|
31
|
-
Stores values for a arbitrary-precision floating point number.
|
32
|
-
|
33
|
-
- [Overview](../datatypes/bignumbers.md)
|
34
|
-
- [Class API](https://mikemcl.github.io/decimal.js/)
|
35
|
-
|
36
|
-
|
37
|
-
## Matrix
|
38
|
-
|
39
|
-
Two types of matrix classes are available in math.js, for storage of dense and sparse matrices. Although they contain public functions documented as follows, using the following API directly is *not* recommended. Prefer using the functions in the "math" namespace wherever possible.
|
40
|
-
|
41
|
-
- [Overview](../datatypes/matrices.md)
|
42
|
-
- [DenseMatrix](classes/densematrix.md)
|
43
|
-
- [SparseMatrix](classes/sparsematrix.md)
|
44
|
-
|
45
|
-
Classes used internally that may be of use to developers:
|
46
|
-
|
47
|
-
- [Index](classes/matrixindex.md)
|
48
|
-
- [Range](classes/matrixrange.md)
|
49
|
-
- [ResultSet](classes/matrixrange.md)
|
50
|
-
- [FibonacciHeap](classes/fibonacciheap.md)
|
51
|
-
|
52
|
-
## Complex
|
53
|
-
|
54
|
-
Stores values for a complex number.
|
55
|
-
|
56
|
-
- [Overview](../datatypes/complex_numbers.md)
|
57
|
-
- [Class API](https://github.com/infusion/Complex.js/)
|
58
|
-
|
59
|
-
## Parser
|
60
|
-
|
61
|
-
The Parser object returned by `math.parser()`.
|
62
|
-
|
63
|
-
- [Overview](../expressions/parsing.md)
|
64
|
-
|
65
|
-
## Node
|
66
|
-
|
67
|
-
A node in an expression-tree, which can be used to analyze, manipulate, and evaluate expressions.
|
68
|
-
|
69
|
-
- [Overview](../expressions/expression_trees.md)
|
70
|
-
|
71
|
-
`Node` is the base class of all other node classes:
|
72
|
-
|
73
|
-
- [AccessorNode](../expressions/expression_trees.md#accessornode)
|
74
|
-
- [ArrayNode](../expressions/expression_trees.md#arraynode)
|
75
|
-
- [AssignmentNode](../expressions/expression_trees.md#assignmentnode)
|
76
|
-
- [BlockNode](../expressions/expression_trees.md#blocknode)
|
77
|
-
- [ConditionalNode](../expressions/expression_trees.md#conditionalnode)
|
78
|
-
- [ConstantNode](../expressions/expression_trees.md#constantnode)
|
79
|
-
- [FunctionAssignmentNode](../expressions/expression_trees.md#functionassignmentnode)
|
80
|
-
- [FunctionNode](../expressions/expression_trees.md#functionnode)
|
81
|
-
- [IndexNode](../expressions/expression_trees.md#indexnode)
|
82
|
-
- [ObjectNode](../expressions/expression_trees.md#objectnode)
|
83
|
-
- [OperatorNode](../expressions/expression_trees.md#operatornode)
|
84
|
-
- [ParenthesisNode](../expressions/expression_trees.md#parenthesisnode)
|
85
|
-
- [RangeNode](../expressions/expression_trees.md#rangenode)
|
86
|
-
- [SymbolNode](../expressions/expression_trees.md#symbolnode)
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Constant reference
|
2
|
-
|
3
|
-
Math.js contains the following constants.
|
4
|
-
|
5
|
-
Constant | Description | Value
|
6
|
-
--------------- | ----------- | -----
|
7
|
-
`e`, `E` | Euler's number, the base of the natural logarithm. | 2.718281828459045
|
8
|
-
`i` | Imaginary unit, defined as `i * i = -1`. A complex number is described as `a + b * i`, where a is the real part, and b is the imaginary part. | `sqrt(-1)`
|
9
|
-
`Infinity` | Infinity, a number which is larger than the maximum number that can be handled by a floating point number. | `Infinity`
|
10
|
-
`LN2` | Returns the natural logarithm of 2. | `0.6931471805599453`
|
11
|
-
`LN10` | Returns the natural logarithm of 10. | `2.302585092994046`
|
12
|
-
`LOG2E` | Returns the base-2 logarithm of E. | `1.4426950408889634`
|
13
|
-
`LOG10E` | Returns the base-10 logarithm of E. | `0.4342944819032518`
|
14
|
-
`NaN` | Not a number. | `NaN`
|
15
|
-
`null` | Value null. | `null`
|
16
|
-
`phi` | Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` | `1.618033988749895`
|
17
|
-
`pi`, `PI` | The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter. | `3.141592653589793`
|
18
|
-
`SQRT1_2` | Returns the square root of 1/2. | `0.7071067811865476`
|
19
|
-
`SQRT2` | Returns the square root of 2. | `1.4142135623730951`
|
20
|
-
`tau` | Tau is the ratio constant of a circle\'s circumference to radius, equal to `2 * pi`. | `6.283185307179586`
|
21
|
-
`undefined` | An undefined value. Preferably, use `null` to indicate undefined values. | `undefined`
|
22
|
-
`version` | Returns the version number of math.js. | For example `0.24.1`
|
23
|
-
|
24
|
-
Example usage:
|
25
|
-
|
26
|
-
```js
|
27
|
-
math.sin(math.pi / 4) // 0.70711
|
28
|
-
math.multiply(math.i, math.i) // -1
|
29
|
-
```
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function abs
|
4
|
-
|
5
|
-
Calculate the absolute value of a number. For matrices, the function is
|
6
|
-
evaluated element wise.
|
7
|
-
|
8
|
-
|
9
|
-
## Syntax
|
10
|
-
|
11
|
-
```js
|
12
|
-
math.abs(x)
|
13
|
-
```
|
14
|
-
|
15
|
-
### Parameters
|
16
|
-
|
17
|
-
Parameter | Type | Description
|
18
|
-
--------- | ---- | -----------
|
19
|
-
`x` | number | BigNumber | Fraction | Complex | Array | Matrix | Unit | A number or matrix for which to get the absolute value
|
20
|
-
|
21
|
-
### Returns
|
22
|
-
|
23
|
-
Type | Description
|
24
|
-
---- | -----------
|
25
|
-
number | BigNumber | Fraction | Complex | Array | Matrix | Unit | Absolute value of `x`
|
26
|
-
|
27
|
-
|
28
|
-
### Throws
|
29
|
-
|
30
|
-
Type | Description
|
31
|
-
---- | -----------
|
32
|
-
|
33
|
-
|
34
|
-
## Examples
|
35
|
-
|
36
|
-
```js
|
37
|
-
math.abs(3.5) // returns number 3.5
|
38
|
-
math.abs(-4.2) // returns number 4.2
|
39
|
-
|
40
|
-
math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2]
|
41
|
-
```
|
42
|
-
|
43
|
-
|
44
|
-
## See also
|
45
|
-
|
46
|
-
[sign](sign.md)
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function acos
|
4
|
-
|
5
|
-
Calculate the inverse cosine of a value.
|
6
|
-
|
7
|
-
For matrices, the function is evaluated element wise.
|
8
|
-
|
9
|
-
|
10
|
-
## Syntax
|
11
|
-
|
12
|
-
```js
|
13
|
-
math.acos(x)
|
14
|
-
```
|
15
|
-
|
16
|
-
### Parameters
|
17
|
-
|
18
|
-
Parameter | Type | Description
|
19
|
-
--------- | ---- | -----------
|
20
|
-
`x` | number | BigNumber | Complex | Array | Matrix | Function input
|
21
|
-
|
22
|
-
### Returns
|
23
|
-
|
24
|
-
Type | Description
|
25
|
-
---- | -----------
|
26
|
-
number | BigNumber | Complex | Array | Matrix | The arc cosine of x
|
27
|
-
|
28
|
-
|
29
|
-
### Throws
|
30
|
-
|
31
|
-
Type | Description
|
32
|
-
---- | -----------
|
33
|
-
|
34
|
-
|
35
|
-
## Examples
|
36
|
-
|
37
|
-
```js
|
38
|
-
math.acos(0.5) // returns number 1.0471975511965979
|
39
|
-
math.acos(math.cos(1.5)) // returns number 1.5
|
40
|
-
|
41
|
-
math.acos(2) // returns Complex 0 + 1.3169578969248166 i
|
42
|
-
```
|
43
|
-
|
44
|
-
|
45
|
-
## See also
|
46
|
-
|
47
|
-
[cos](cos.md),
|
48
|
-
[atan](atan.md),
|
49
|
-
[asin](asin.md)
|
@@ -1,47 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function acosh
|
4
|
-
|
5
|
-
Calculate the hyperbolic arccos of a value,
|
6
|
-
defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.
|
7
|
-
|
8
|
-
For matrices, the function is evaluated element wise.
|
9
|
-
|
10
|
-
|
11
|
-
## Syntax
|
12
|
-
|
13
|
-
```js
|
14
|
-
math.acosh(x)
|
15
|
-
```
|
16
|
-
|
17
|
-
### Parameters
|
18
|
-
|
19
|
-
Parameter | Type | Description
|
20
|
-
--------- | ---- | -----------
|
21
|
-
`x` | number | Complex | Unit | Array | Matrix | Function input
|
22
|
-
|
23
|
-
### Returns
|
24
|
-
|
25
|
-
Type | Description
|
26
|
-
---- | -----------
|
27
|
-
number | Complex | Array | Matrix | Hyperbolic arccosine of x
|
28
|
-
|
29
|
-
|
30
|
-
### Throws
|
31
|
-
|
32
|
-
Type | Description
|
33
|
-
---- | -----------
|
34
|
-
|
35
|
-
|
36
|
-
## Examples
|
37
|
-
|
38
|
-
```js
|
39
|
-
math.acosh(1.5) // returns 0.9624236501192069
|
40
|
-
```
|
41
|
-
|
42
|
-
|
43
|
-
## See also
|
44
|
-
|
45
|
-
[cosh](cosh.md),
|
46
|
-
[asinh](asinh.md),
|
47
|
-
[atanh](atanh.md)
|
@@ -1,48 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function acot
|
4
|
-
|
5
|
-
Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.
|
6
|
-
|
7
|
-
For matrices, the function is evaluated element wise.
|
8
|
-
|
9
|
-
|
10
|
-
## Syntax
|
11
|
-
|
12
|
-
```js
|
13
|
-
math.acot(x)
|
14
|
-
```
|
15
|
-
|
16
|
-
### Parameters
|
17
|
-
|
18
|
-
Parameter | Type | Description
|
19
|
-
--------- | ---- | -----------
|
20
|
-
`x` | number | Complex | Array | Matrix | Function input
|
21
|
-
|
22
|
-
### Returns
|
23
|
-
|
24
|
-
Type | Description
|
25
|
-
---- | -----------
|
26
|
-
number | Complex | Array | Matrix | The arc cotangent of x
|
27
|
-
|
28
|
-
|
29
|
-
### Throws
|
30
|
-
|
31
|
-
Type | Description
|
32
|
-
---- | -----------
|
33
|
-
|
34
|
-
|
35
|
-
## Examples
|
36
|
-
|
37
|
-
```js
|
38
|
-
math.acot(0.5) // returns number 0.4636476090008061
|
39
|
-
math.acot(math.cot(1.5)) // returns number 1.5
|
40
|
-
|
41
|
-
math.acot(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
|
42
|
-
```
|
43
|
-
|
44
|
-
|
45
|
-
## See also
|
46
|
-
|
47
|
-
[cot](cot.md),
|
48
|
-
[atan](atan.md)
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function acoth
|
4
|
-
|
5
|
-
Calculate the hyperbolic arccotangent of a value,
|
6
|
-
defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.
|
7
|
-
|
8
|
-
For matrices, the function is evaluated element wise.
|
9
|
-
|
10
|
-
|
11
|
-
## Syntax
|
12
|
-
|
13
|
-
```js
|
14
|
-
math.acoth(x)
|
15
|
-
```
|
16
|
-
|
17
|
-
### Parameters
|
18
|
-
|
19
|
-
Parameter | Type | Description
|
20
|
-
--------- | ---- | -----------
|
21
|
-
`x` | number | Complex | Array | Matrix | Function input
|
22
|
-
|
23
|
-
### Returns
|
24
|
-
|
25
|
-
Type | Description
|
26
|
-
---- | -----------
|
27
|
-
number | Complex | Array | Matrix | Hyperbolic arccotangent of x
|
28
|
-
|
29
|
-
|
30
|
-
### Throws
|
31
|
-
|
32
|
-
Type | Description
|
33
|
-
---- | -----------
|
34
|
-
|
35
|
-
|
36
|
-
## Examples
|
37
|
-
|
38
|
-
```js
|
39
|
-
math.acoth(0.5) // returns 0.8047189562170503
|
40
|
-
```
|
41
|
-
|
42
|
-
|
43
|
-
## See also
|
44
|
-
|
45
|
-
[acsch](acsch.md),
|
46
|
-
[asech](asech.md)
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function acsc
|
4
|
-
|
5
|
-
Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`.
|
6
|
-
|
7
|
-
For matrices, the function is evaluated element wise.
|
8
|
-
|
9
|
-
|
10
|
-
## Syntax
|
11
|
-
|
12
|
-
```js
|
13
|
-
math.acsc(x)
|
14
|
-
```
|
15
|
-
|
16
|
-
### Parameters
|
17
|
-
|
18
|
-
Parameter | Type | Description
|
19
|
-
--------- | ---- | -----------
|
20
|
-
`x` | number | Complex | Array | Matrix | Function input
|
21
|
-
|
22
|
-
### Returns
|
23
|
-
|
24
|
-
Type | Description
|
25
|
-
---- | -----------
|
26
|
-
number | Complex | Array | Matrix | The arc cosecant of x
|
27
|
-
|
28
|
-
|
29
|
-
### Throws
|
30
|
-
|
31
|
-
Type | Description
|
32
|
-
---- | -----------
|
33
|
-
|
34
|
-
|
35
|
-
## Examples
|
36
|
-
|
37
|
-
```js
|
38
|
-
math.acsc(0.5) // returns number 0.5235987755982989
|
39
|
-
math.acsc(math.csc(1.5)) // returns number ~1.5
|
40
|
-
|
41
|
-
math.acsc(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
|
42
|
-
```
|
43
|
-
|
44
|
-
|
45
|
-
## See also
|
46
|
-
|
47
|
-
[csc](csc.md),
|
48
|
-
[asin](asin.md),
|
49
|
-
[asec](asec.md)
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
2
|
-
|
3
|
-
# Function acsch
|
4
|
-
|
5
|
-
Calculate the hyperbolic arccosecant of a value,
|
6
|
-
defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.
|
7
|
-
|
8
|
-
For matrices, the function is evaluated element wise.
|
9
|
-
|
10
|
-
|
11
|
-
## Syntax
|
12
|
-
|
13
|
-
```js
|
14
|
-
math.acsch(x)
|
15
|
-
```
|
16
|
-
|
17
|
-
### Parameters
|
18
|
-
|
19
|
-
Parameter | Type | Description
|
20
|
-
--------- | ---- | -----------
|
21
|
-
`x` | number | Complex | Array | Matrix | Function input
|
22
|
-
|
23
|
-
### Returns
|
24
|
-
|
25
|
-
Type | Description
|
26
|
-
---- | -----------
|
27
|
-
number | Complex | Array | Matrix | Hyperbolic arccosecant of x
|
28
|
-
|
29
|
-
|
30
|
-
### Throws
|
31
|
-
|
32
|
-
Type | Description
|
33
|
-
---- | -----------
|
34
|
-
|
35
|
-
|
36
|
-
## Examples
|
37
|
-
|
38
|
-
```js
|
39
|
-
math.acsch(0.5) // returns 1.4436354751788103
|
40
|
-
```
|
41
|
-
|
42
|
-
|
43
|
-
## See also
|
44
|
-
|
45
|
-
[asech](asech.md),
|
46
|
-
[acoth](acoth.md)
|