| 443 | return result.length == 1 ? result[0] : result |
| 444 | } |
| 445 | cosh(n) { |
| 446 | if (n.isComplex) { |
| 447 | const a = n.a.toNumber() |
| 448 | const b = n.b.toNumber() |
| 449 | |
| 450 | const re = Math.cos(b) * Math.cosh(a) |
| 451 | const im = Math.sin(b) * Math.sinh(a) |
| 452 | |
| 453 | return this.complex(re, im) |
| 454 | } |
| 455 | if (typeof n != 'object' || BigNumber.isBigNumber(n)) { |
| 456 | n = BigNumber.isBigNumber(n) == true ? n.toNumber() : n |
| 457 | n = [n] |
| 458 | } |
| 459 | let result = [] |
| 460 | for (var i = 0; i < n.length; i++) { |
| 461 | result.push(Math.cosh(n[i]).toFixed(15)) |
| 462 | } |
| 463 | return result.length == 1 ? result[0] : result |
| 464 | } |
| 465 | deg2rad(x) { |
| 466 | return new BigNumber(x).times(this.pi).div(180) |
| 467 | } |