---
title: atan
description: "atan function in PySpark: Compute inverse tangent of the input column."
canonical_url: https://docs.databricks.com/aws/en/pyspark/reference/functions/atan
---

# atan

Compute inverse tangent of the input column. Supports Spark Connect.

For the corresponding Databricks SQL function, see [`atan` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/atan.md).

## Syntax

```python
from pyspark.sql import functions as dbf

dbf.atan(col=<col>)
```

## Parameters

| Parameter | Type                                | Description                  |
| --------- | ----------------------------------- | ---------------------------- |
| `col`     | `pyspark.sql.Column or column name` | target column to compute on. |

## Returns

`pyspark.sql.Column`: inverse tangent of `col`, as if computed by `java.lang.Math.atan()`

## Examples

```python
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(-0.5,), (0.0,), (0.5,)], ["value"])
df.select("*", dbf.atan(df.value)).show()
```

```Output
+-----+-------------------+
|value|        ATAN(value)|
+-----+-------------------+
| -0.5|-0.4636476090008...|
|  0.0|                0.0|
|  0.5| 0.4636476090008...|
+-----+-------------------+

```

```python
from pyspark.sql import functions as dbf
spark.sql(
    "SELECT * FROM VALUES (FLOAT('NAN')), (NULL) AS TAB(value)"
).select("*", dbf.atan("value")).show()
```

```Output
+-----+-----------+
|value|ATAN(value)|
+-----+-----------+
|  NaN|        NaN|
| NULL|       NULL|
+-----+-----------+
```
