tan

tan(x: array, /) array

Calculates an implementation-dependent approximation to the tangent, having domain (-infinity, +infinity) and codomain (-infinity, +infinity), for each element x_i of the input array x. Each element x_i is assumed to be expressed in radians.

Special cases

For floating-point operands,

  • If x_i is NaN, the result is NaN.

  • If x_i is +0, the result is +0.

  • If x_i is -0, the result is -0.

  • If x_i is either +infinity or -infinity, the result is NaN.

Parameters:

x (array) – input array whose elements are expressed in radians. Should have a floating-point data type.

Returns:

out (array) – an array containing the tangent of each element in x. The returned array must have a floating-point data type determined by Type Promotion Rules.