cos
Description
Calculate the triangular cosine of each element, that is, cos(x).
Mandatory Input Parameters
Parameter |
Type |
Description |
|---|---|---|
x |
array_like |
Input array or scalar, in radians |
Optional Input Parameters
Return Value
Type |
Description |
|---|---|
ndarray/scalar |
Triangular cosine of each element |
Examples
1 2 3 4 5 6 7 8 | >>> import numpy as np >>> np.cos(np.pi) -1.0 >>> x = np.array([0., 30., 45., 60., 90.]) * np.pi / 180.0 >>> np.cos(x) array([1.00000000e+00, 8.66025404e-01, 7.07106781e-01, 5.00000000e-01, 6.12323400e-17]) >>> |
Parent topic: Basic Operation Functions