---
schema_version: "1"
id: be129866f53b5a00201d518f2398e04e35a27ff8c587953f78a100b0eb75f02b
title: cos
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-math-functions-cos.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-math-functions-cos
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 3476e3f34473b307cc6dc561c2b262465c2a3cd67682dd8ca73d7793a6a7ca5c
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# cos

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## cos(angle: Number): Number

Returns the trigonometric cosine of an angle from a given number of radians.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>angle</code></p></td><td><div><div><p>Number of radians in an angle.</p></div></div></td></tr></tbody></table>

### Example

This example shows how `cos` behaves with different inputs.

#### Source

```DataWeave
%dw 2.0
import * from dw::util::Math
output application/json
---
{
  "cos0": cos(0),
  "cos13": cos(0.13),
  "cos-1": cos(-1)
}
```

#### Output

```Json
{
  "cos0": 1.0,
  "cos13": 0.9915618937147881,
  "cos-1": 0.5403023058681398
}
```
