atan.js 1.0 KB

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