argument.php 828 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. *
  4. * Function code for the complex argument() function
  5. *
  6. * @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
  7. * @license https://opensource.org/licenses/MIT MIT
  8. */
  9. namespace Complex;
  10. /**
  11. * Returns the argument of a complex number.
  12. * Also known as the theta of the complex number, i.e. the angle in radians
  13. * from the real axis to the representation of the number in polar coordinates.
  14. *
  15. * This function is a synonym for theta()
  16. *
  17. * @param Complex|mixed $complex Complex number or a numeric value.
  18. * @return float The argument (or theta) value of the complex argument.
  19. * @throws Exception If argument isn't a valid real or complex number.
  20. *
  21. * @see theta
  22. */
  23. function argument($complex)
  24. {
  25. return theta($complex);
  26. }