atan.js 1.2 KB

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