---
title: arctan
description: "计算每个元素的反三角正切值，即1 / tan(x)。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC1/accel/kunpengaccel_kml_16_0528.html
sourcePath: /source/zh/kunpengboostkithistory/240RC1/accel/kunpengaccel_kml_16_0528.html
indexId: 47bd549f07a263dc6f91b62ef13629051b9827f4c7c7bdbd349b0456ff64b09076
---
# arctan

#### 功能描述

计算每个元素的反三角正切值，即1 / tan(x)。


#### 必选输入参数

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| x | array\_like | 输入的数组或标量。 |


#### 可选输入参数

| 参数名 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| out | ndarray/ndarray的元组 | None | 计算结果保存的位置。如果提供，其形状必须与输入数组广播后的形状一致。未指定时，返回一个新的数组。 |
| where | array\_like | None | 将被广播至输入的条件数组。在条件为真处的元素，其计算结果会存入out中，其余位置保留原有值。 |
| \*\*kwargs | \- | \- | 其他关键字参数，请参见NumPy官方文档Universal functions (ufunc)(https://numpy.org/doc/stable/reference/ufuncs.html\#ufuncs\-kwargs)。 |


#### 返回数据

| 类型 | 说明 |
| --- | --- |
| ndarray/scalar | 每个元素的反三角正切计算结果，单位为弧度。实部的取值范围为[\-π/2, π/2]。 |


#### 示例

```
>>> import numpy as np
>>> np.pi / 4
0.7853981633974483
>>> np.tan([0., np.pi / 4])
array([0., 1.])
>>>
>>> np.arctan([0., 1.])
array([0.        , 0.78539816])
>>>
```
