Skip to content

Compute tangent

Source code

Description

Compute tangent

Usage

<Expr>$tan()

Value

Expr

Examples

library(polars)

pl$DataFrame(a = c(0, pi / 2, pi, NA_real_))$
  with_columns(tangent = pl$col("a")$tan())
#> shape: (4, 2)
#> ┌──────────┬─────────────┐
#> │ a        ┆ tangent     │
#> │ ---      ┆ ---         │
#> │ f64      ┆ f64         │
#> ╞══════════╪═════════════╡
#> │ 0.0      ┆ 0.0         │
#> │ 1.570796 ┆ 1.6331e16   │
#> │ 3.141593 ┆ -1.2246e-16 │
#> │ null     ┆ null        │
#> └──────────┴─────────────┘