Skip to content

Compute cotangent

Description

Compute cotangent

Usage

<Expr>$cot()

Value

A polars expression

Examples

library("polars")

pl$DataFrame(a = c(0, pi / 2, -5, NA))$
  with_columns(cotangent = pl$col("a")$cot())
#> shape: (4, 2)
#> ┌──────────┬────────────┐
#> │ a        ┆ cotangent  │
#> │ ---      ┆ ---        │
#> │ f64      ┆ f64        │
#> ╞══════════╪════════════╡
#> │ 0.0      ┆ inf        │
#> │ 1.570796 ┆ 6.1232e-17 │
#> │ -5.0     ┆ 0.295813   │
#> │ null     ┆ null       │
#> └──────────┴────────────┘