---
schema_version: "1"
id: 38bac80fad942e3595407bbee92d66658b12fe088ab7f746e510751a0fa720e3
title: cos
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-math-functions-cos.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-math-functions-cos
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d70327a217ba22992e6f2ad47aca4382a4677845f6ecc007970b842fbdc30a21
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

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