Skip to content

Compute inverse tangent

Source code

Description

Compute inverse tangent

Usage

<Expr>$arctan()

Value

Expr

Examples

library("polars")

pl$DataFrame(a = c(-1, tan(0.5), 0, 1, NA_real_))$
  with_columns(arctan = pl$col("a")$arctan())
#> shape: (5, 2)
#> ┌──────────┬───────────┐
#> │ a        ┆ arctan    │
#> │ ---      ┆ ---       │
#> │ f64      ┆ f64       │
#> ╞══════════╪═══════════╡
#> │ -1.0     ┆ -0.785398 │
#> │ 0.546302 ┆ 0.5       │
#> │ 0.0      ┆ 0.0       │
#> │ 1.0      ┆ 0.785398  │
#> │ null     ┆ null      │
#> └──────────┴───────────┘