Compute tangent element-wise.
This function has no parameters.
The new SciPhp\NdArray The corresponding tangent values.
use SciPhp\NumPhp as np;
$x = np::ar([
[0 , M_PI_2 / 2, - M_PI / 4],
[M_PI / 4, M_PI_2 / 2, 0 ]
]);
$y = $x->tan();
echo "x=\n$x", "y=\n$y";
The above example will output:
x= [[0 0.78539816339745 -0.78539816339745] [0.78539816339745 0.78539816339745 0 ]] y= [[0 1 -1] [1 1 0 ]]