> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Aggregate function that calculates the slope between the leftmost and rightmost points across a group of values.

# boundingRatio

<h2 id="boundingRatio">
  boundingRatio
</h2>

Introduced in: v20.1.0

Calculates the slope between the leftmost and rightmost points across a group of values.

**Syntax**

```sql theme={null}
boundingRatio(x, y)
```

**Arguments**

* `x` — X-coordinate values. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)
* `y` — Y-coordinate values. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)

**Returned value**

Returns the slope of the line between the leftmost and rightmost points, otherwise returns `NaN` if the data is empty. [`Float64`](/reference/data-types/float)

**Examples**

**Sample data**

```sql title=Query theme={null}
SELECT
    number,
    number * 1.5
FROM numbers(10)
```

```response title=Response theme={null}
┌─number─┬─multiply(number, 1.5)─┐
│      0 │                     0 │
│      1 │                   1.5 │
│      2 │                     3 │
│      3 │                   4.5 │
│      4 │                     6 │
│      5 │                   7.5 │
│      6 │                     9 │
│      7 │                  10.5 │
│      8 │                    12 │
│      9 │                  13.5 │
└────────┴───────────────────────┘
```

**Usage example**

```sql title=Query theme={null}
SELECT boundingRatio(number, number * 1.5)
FROM numbers(10)
```

```response title=Response theme={null}
┌─boundingRatio(number, multiply(number, 1.5))─┐
│                                          1.5 │
└──────────────────────────────────────────────┘
```
