| 509 | return result.length == 1 ? result[0] : result |
| 510 | } |
| 511 | sinh(n) { |
| 512 | if (n.isComplex) { |
| 513 | const a = n.a.toNumber() |
| 514 | const b = n.b.toNumber() |
| 515 | |
| 516 | const re = Math.cos(b) * Math.sinh(a) |
| 517 | const im = Math.cosh(a) * Math.sin(b) |
| 518 | |
| 519 | return this.complex(re, im) |
| 520 | } |
| 521 | if (typeof n != 'object' || BigNumber.isBigNumber(n)) { |
| 522 | n = BigNumber.isBigNumber(n) == true ? n.toNumber() : n |
| 523 | n = [n] |
| 524 | } |
| 525 | let result = [] |
| 526 | for (var i = 0; i < n.length; i++) { |
| 527 | result.push(Math.sinh(n[i]).toFixed(15)) |
| 528 | } |
| 529 | return result.length == 1 ? result[0] : result |
| 530 | } |
| 531 | tan(n) { |
| 532 | if (n.isComplex) { |
| 533 | const Ta = n.a.times(2).toNumber() |