NdArray::sin

Trigonometric sine, element-wise.

Description

SciPhp\NdArray NdArray::sin()

Parameters

This function has no parameters.

Return Values

The new SciPhp\NdArray The sine of each element of m.

Examples

Example #1: Sine of matrix values

use SciPhp\NumPhp as np;

$x np::ar([
    [
0   M_PI_2M_PI], 
    [
M_PIM_PI_20   ]
]);

$y $x->sin();

echo 
"x=\n$x\n""y=\n$y\n";

The above example will output:

x=
[[0                1.5707963267949  3.1415926535898]
 [3.1415926535898  1.5707963267949  0              ]]

y=
[[0                    1                    1.2246467991474E-16]
 [1.2246467991474E-16  1                    0                  ]]

See Also