---
title: math.cos() function
description: math.cos() returns the cosine of the radian argument x.
url: https://docs.influxdata.com/flux/v0/stdlib/math/cos/
estimated_tokens: 601
product: Flux
version: v0
---

# math.cos() function

-   Flux 0.22.0+
-   View InfluxDB support

`math.cos()` returns the cosine of the radian argument `x`.

##### Function type signature

```js
(x: float) => float
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### x

(Required) Value to operate on.

## Examples

### Use math.cos in map

```js
import "math"
import "sampledata"

sampledata.float()
    |> map(fn: (r) => ({_time: r._time, _value: math.cos(x: r._value)}))
```
