csch.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.createCsch = void 0;
  6. var _factory = require("../../utils/factory.js");
  7. var _index = require("../../plain/number/index.js");
  8. var name = 'csch';
  9. var dependencies = ['typed', 'BigNumber'];
  10. var createCsch = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) {
  11. var typed = _ref.typed,
  12. _BigNumber = _ref.BigNumber;
  13. /**
  14. * Calculate the hyperbolic cosecant of a value,
  15. * defined as `csch(x) = 1 / sinh(x)`.
  16. *
  17. * To avoid confusion with the matrix hyperbolic cosecant, this function
  18. * does not apply to matrices.
  19. *
  20. * Syntax:
  21. *
  22. * math.csch(x)
  23. *
  24. * Examples:
  25. *
  26. * // csch(x) = 1/ sinh(x)
  27. * math.csch(0.5) // returns 1.9190347513349437
  28. * 1 / math.sinh(0.5) // returns 1.9190347513349437
  29. *
  30. * See also:
  31. *
  32. * sinh, sech, coth
  33. *
  34. * @param {number | BigNumber | Complex} x Function input
  35. * @return {number | BigNumber | Complex} Hyperbolic cosecant of x
  36. */
  37. return typed(name, {
  38. number: _index.cschNumber,
  39. Complex: function Complex(x) {
  40. return x.csch();
  41. },
  42. BigNumber: function BigNumber(x) {
  43. return new _BigNumber(1).div(x.sinh());
  44. }
  45. });
  46. });
  47. exports.createCsch = createCsch;