scipp.cos#

scipp.cos(x, *, out=None)#

Element-wise cosine.

The input must have a plane-angle unit, i.e. rad, deg.

Parameters:
Returns:

Same type as input – The cosine values of the input.

Examples

Compute cosine of angles in radians:

>>> import scipp as sc
>>> import numpy as np
>>> angle = sc.array(dims=['x'], values=[0.0, np.pi/6, np.pi/3, np.pi/2], unit='rad')
>>> sc.cos(angle)
<scipp.Variable> (x: 4)    float64  [dimensionless]  [1, 0.866025, 0.5, ...]

The output is dimensionless.