ATAN2()

Overview

Returns the arc tangent angle based on the length of the opposite and adjacent sides.

USAGE

```ATAN2(opposite_length, adjacent_length)
ATAN2(ratio)
```

Argument Name

Description

`opposite_length`

The lengths of the triangle's opposite sides

`adjacent_length`

The lengths of the triangle's adjacent sides

`ratio`

The tangent slope's ratio

DETAILS

`ATAN2()` is a trigonometric function that returns the arc tangent angle (in radians) based on the length of a triangle's opposite and adjacent sides.

When two arguments are supplied, the returned angle can be in any quadrant since it knows which lengths are positive and which are negative. The units used to measure the lengths don't matter as long as the same units are used in both measurements.

When one argument is supplied, it behaves as an alias for ATAN() and only returns angles in quadrants I and IV.

A `NULL` is returned if either of the arguments is `NULL`.

EXAMPLES

```SELECT ATAN2(-10, -5), ATAN2(2);
```
```+------------------+-----------------+
| ATAN2(-10, -5)   | ATAN2(2)        |
+------------------+-----------------+
| -2.0344439357957 | 1.1071487177941 |
+------------------+-----------------+
```
```SELECT ATAN2(-1, 1);
```
```+-------------------+
| ATAN2(-1, 1)      |
+-------------------+
| -0.78539816339745 |
+-------------------+
```

CHANGE HISTORY

Release Series

History

23.09

• Present starting in MariaDB Xpand 23.09.1.

6.1

• Present starting in MariaDB Xpand 6.1.0.

6.0

• Present starting in MariaDB Xpand 6.0.3.

5.3

• Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

• Present starting in MariaDB Xpand 6.0.3.

5.3

• Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

• Present starting in MariaDB Xpand 6.1.0.