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

# 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
}
```
