Rate This Document
Findability
Accuracy
Completeness
Readability

tan

Description

Calculate the triangular tangent of each element, that is, tan(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/ndarray tuple

None

Location where the calculation result is stored. If provided, it must have a shape that 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 tangent of each element

Examples

>>> import numpy as np
>>> np.tan(np.pi / 4)
0.9999999999999999
>>> x = np.array([0., 30., 45., 60., 90.]) * np.pi / 180.0
>>> np.tan(x)
array([0.00000000e+00, 5.77350269e-01, 1.00000000e+00, 1.73205081e+00,
       1.63312394e+16])
>>>