我要评分
获取效率
正确性
完整性
易理解

sin

Description

Calculate the triangular sine of each element, that is, sin(x).

Mandatory Input Parameters

Parameter

Type

Description

x

array_like

Input array or scalar, in radians

Optional Input Parameters

Parameter

Type

Default Value

Description

out

ndarray or ndarray tuple

None

Location where the calculation result is stored. If provided, it must have a shape which the inputs broadcast to. If not provided, a freshly-allocated array is returned.

where

array_like

None

This condition is broadcast over the input. At locations where the condition is true, the out array stores the result. Elsewhere, the out array retains its original value.

**kwargs

-

-

Other keyword arguments. Refer to the NumPy official document Universal functions (ufunc).

Return Value

Type

Description

ndarray/scalar

Triangular sine of each element

Examples

1
2
3
4
5
6
7
>>> import numpy as np
>>> np.sin(np.pi / 2)
1.0
>>> x = np.array([0., 30., 45., 60., 90.]) * np.pi / 180.0
>>> np.sin(x)
array([0.        , 0.5       , 0.70710678, 0.8660254 , 1.        ])
>>>