> ## Documentation Index
> Fetch the complete documentation index at: https://axiom.co/docs/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://axiom.co/docs/feedback

```json
{
  "path": "/apl/scalar-functions/mathematical-functions/degrees",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# degrees

> This page explains how to use the degrees function in APL.

Use the `degrees` function in APL to convert an angle from radians to degrees. The conversion formula is `degrees = (180 / π) × angle_in_radians`.

`degrees` is useful whenever you compute angles using trigonometric or inverse trigonometric functions, which return values in radians, but need the result expressed in degrees for display or comparison. For example, you can convert the output of `atan2` or `acos` into a degree value that's easier to interpret.

## For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.

<AccordionGroup>
  <Accordion title="Splunk SPL users">
    Splunk SPL doesn't include a built-in `degrees()` function. You compute the conversion manually by multiplying the radian value by `180 / pi()`.

    <CodeGroup>
      ```sql Splunk example theme={null}
      | eval angle_deg = angle_rad * (180 / pi())
      ```

      ```kusto APL equivalent theme={null}
      ['sample-http-logs']
      | extend angle_deg = degrees(angle_rad)
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="ANSI SQL users">
    In SQL Server and PostgreSQL, `DEGREES()` is a built-in function with identical semantics to the APL version.

    <CodeGroup>
      ```sql SQL example theme={null}
      SELECT DEGREES(angle_rad) AS angle_deg FROM logs
      ```

      ```kusto APL equivalent theme={null}
      ['sample-http-logs']
      | extend angle_deg = degrees(angle_rad)
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## Usage

### Syntax

```kusto theme={null}
degrees(a)
```

### Parameters

| Name | Type | Required | Description                      |
| ---- | ---- | -------- | -------------------------------- |
| `a`  | real | Yes      | The angle in radians to convert. |

### Returns

The angle in degrees corresponding to the input radian value.

## Example

Use `degrees` to convert an angle in radians to degrees.

**Query**

```kusto theme={null}
print result = degrees(pi())
```

[Run in Playground](https://play.axiom.co/axiom-play-qf1k/query?initForm=%7B%22apl%22%3A%20%22print%20result%20%3D%20degrees%28pi%28%29%29%22%7D)

**Output**

| result |
| ------ |
| 180    |

## List of related functions

* [radians](/apl/scalar-functions/mathematical-functions/radians): Converts degrees to radians. Use it for the inverse conversion before passing values to trigonometric functions.
* [pi](/apl/scalar-functions/mathematical-functions/pi): Returns the constant π. Use it in manual radian-to-degree conversions as an alternative to `degrees`.
* [cos](/apl/scalar-functions/mathematical-functions/cos): Returns the cosine of an angle in radians. Use `degrees` to convert its output for display.
* [sin](/apl/scalar-functions/mathematical-functions/sin): Returns the sine of an angle in radians. Use `degrees` to convert angular results.
* [atan2](/apl/scalar-functions/mathematical-functions/atan2): Returns an angle in radians from two coordinates. Use `degrees` to convert its output to degrees.
