> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/numeric/cos",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for COS function

# COS

export const QueryWindow = ({content}) => {
  const {sql, result} = content;
  const [inited, setInited] = useState(false);
  const buttonRef = useRef(null);
  useEffect(() => {
    if (!inited && buttonRef.current) {
      runQuery(buttonRef.current, true);
      setInited(true);
    }
  }, []);
  return <div className="query-window">
      <div className="query-toolbar">
        <button className="run-button" onClick={ev => runQuery(ev.target)} ref={buttonRef}>Run Query</button>
        <span className="window-title">Interactive SQL Playground 🔥</span>
      </div>
      <div className="query-content">
        <pre><code className="firebolt-sql language-sql" contentEditable="true" spellCheck="false" data-original-query={sql}>{sql}</code></pre>
        <script type="application/json" className="fallback-result" style={{
    display: "none"
  }}>{JSON.stringify(result)}</script>
        <div className="server-unavailable-banner query-window-hidden">
          The Firebolt playground server is currently unavailable. Using precomputed query results.
        </div>
        <div className="query-results"></div>
      </div>
    </div>;
};

Trigonometric function that calculates the cosine of a specific value in radians.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
COS(<value>)
```

## Parameters

| Parameter | Description                                               | Supported input types |
| :-------- | :-------------------------------------------------------- | :-------------------- |
| `<value>` | The value that determines the returned cosine in radians. | `DOUBLE PRECISION`    |

## Return Type

`COS` returns a value of type `DOUBLE PRECISION`.

## Example

The following query calculates the cosine of 0:

<QueryWindow
  content={{
"sql": "SELECT COS(0) as result;",
"result": {
"data": [
  [
    1
  ]
],
"meta": [
  {
    "name": "result",
    "type": "double"
  }
],
"query": {
  "query_id": "8d9ba394-26be-4438-b15f-ebe2726b559f",
  "query_label": null,
  "request_id": "844acb8c-3f64-4293-b641-25efd9ff3f5f"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.008375,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000240393,
  "time_to_execute": 0.000100222
}
}
}}
/>

The following query calculates the cosine of pi:

<QueryWindow
  content={{
"sql": "SELECT ROUND(COS(PI()), 5) as result;",
"result": {
"data": [
  [
    -1
  ]
],
"meta": [
  {
    "name": "result",
    "type": "double"
  }
],
"query": {
  "query_id": "dfd0890a-dc83-4a03-8b91-331e61b96114",
  "query_label": null,
  "request_id": "54d76ca1-7335-427f-a703-245bf20b4a29"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.006933,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000243688,
  "time_to_execute": 0.000112057
}
}
}}
/>
