sinh.js 893 B

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