Files
PhpSpreadsheet/tests/data/Calculation/MathTrig/ATAN2.php
T
oleibman 0ce8509a8c Continue MathTrig Breakup - Trig Functions (#1905)
* Continue MathTrig Breakup - Trig Functions

Continuing the process of breaking MathTrip.php up into smaller classes.
This round takes care of the trig and hyperbolic functions, plus a few others.
- COS, COSH, ACOS, ACOSH
- COT, COTH, ACOT, ACOTH
- CSC, CSCH
- SEC, SECH
- SIN, SINH, ASIN, ASINH
- TAN, TANH, ATAN, ATANH, ATAN2
- EVEN
- ODD
- SIGN

There are no bug fixes in this PR, except that boolean arguments are now
accepted for all these functions, as they are for Excel.
Taking a cue from what has been done in Engineering, the parameter validation
now happens in a routine which issues Exceptions for invalid values;
this simplifies the code in the functions themselves.

Consistent with earlier changes of this nature, the versions in the
MathTrig class remain, with a doc block indicating deprecation,
and a stub call to the new routines.

I think several more iterations will be needed to break up MathTrig completely.
2021-03-13 12:06:30 +01:00

27 lines
586 B
PHP

<?php
// x_num, y_num, Result
return [
['#DIV/0!', '0, 0'],
[M_PI_4, '1, 1'],
[-3 * M_PI_4, '-1, -1'],
[3 * M_PI_4, '-1, 1'],
[-M_PI_4, '1, -1'],
[1.107148717, '0.5, 1'],
[1.815774989, '-0.5, 2'],
[0.674740942, '1, 0.8'],
[-0.643501109, '0.8, -0.6'],
[-1.460139105, '1, -9'],
[0.0, '0.2, 0'],
[1.107148718, '0.1, 0.2'],
[M_PI_2, '0, 0.2'],
['#VALUE!', '"A", 0.2'],
['#VALUE!', '0.2, "A"'],
[M_PI_4, 'true, 1'],
[-M_PI_2, 'false, -2.5'],
['exception', ''],
['exception', '1'],
[0.876058051, 'A2, A3'],
];