csch.js 1.0 KB

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