cos¶
- cos(x: array, /) array¶
Calculates an implementation-dependent approximation to the cosine, having domain
(-infinity, +infinity)and codomain[-1, +1], for each elementx_iof the input arrayx. Each elementx_iis assumed to be expressed in radians.Special cases
For floating-point operands,
If
x_iisNaN, the result isNaN.If
x_iis+0, the result is1.If
x_iis-0, the result is1.If
x_iis+infinity, the result isNaN.If
x_iis-infinity, the result isNaN.
- Parameters:
x (array) – input array whose elements are each expressed in radians. Should have a floating-point data type.
- Returns:
out (array) – an array containing the cosine of each element in
x. The returned array must have a floating-point data type determined by Type Promotion Rules.