acot.js 1.3 KB

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