Skip to content

Compute inverse cosine

Source code

Description

Compute inverse cosine

Usage

<Expr>$arccos()

Value

Expr

Examples

library(polars)

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