# ST_DISTANCE

The ST_DISTANCE function calculates the distance between two points.

## Syntax

`ST_DISTANCE(geomA, geomB)`

### Parameters

#### geomA

This is an expression of type `geo_point` or `cartesian_point`.

#### geomB

This is an expression of type `geo_point` or `cartesian_point`.

## Examples

```esql
FROM airports
| WHERE abbrev == "CPH"
| EVAL distance = ST_DISTANCE(location, city_location)
| KEEP abbrev, name, location, city_location, distance
```

```esql
FROM airports
| WHERE abbrev == "JFK"
| EVAL distance = ST_DISTANCE(location, city_location)
| KEEP abbrev, name, location, city_location, distance
```

## Limitations

- It's important to note that the second parameter must have the same coordinate system as the first. Therefore, it's not possible to combine `geo_point` and `cartesian_point` parameters.
