1 | 'use strict';
|
2 |
|
3 | var deepMap = require('../../utils/collection/deepMap');
|
4 |
|
5 | function factory(type, config, load, typed) {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | var sinh = typed('sinh', {
|
28 | 'number': _sinh,
|
29 |
|
30 | 'Complex': function Complex(x) {
|
31 | return x.sinh();
|
32 | },
|
33 |
|
34 | 'BigNumber': function BigNumber(x) {
|
35 | return x.sinh();
|
36 | },
|
37 |
|
38 | 'Unit': function Unit(x) {
|
39 | if (!x.hasBase(type.Unit.BASE_UNITS.ANGLE)) {
|
40 | throw new TypeError('Unit in function sinh is no angle');
|
41 | }
|
42 | return sinh(x.value);
|
43 | },
|
44 |
|
45 | 'Array | Matrix': function ArrayMatrix(x) {
|
46 |
|
47 | return deepMap(x, sinh, true);
|
48 | }
|
49 | });
|
50 |
|
51 | sinh.toTex = { 1: '\\sinh\\left(${args[0]}\\right)' };
|
52 |
|
53 | return sinh;
|
54 | }
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | var _sinh = Math.sinh || function (x) {
|
63 | return (Math.exp(x) - Math.exp(-x)) / 2;
|
64 | };
|
65 |
|
66 | exports.name = 'sinh';
|
67 | exports.factory = factory; |
\ | No newline at end of file |