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

# ST_FrechetDistance

Computes and returns discrete [Frechet Distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance) between the given two geometries,
based on [Computing Discrete Frechet Distance](http://www.kr.tuwien.ac.at/staff/eiter/et-archive/files/cdtr9464.pdf)

If any of the geometries is empty, returns 0.0

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_FrechetDistance/ST_FrechetDistance.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=6d277b9739f84e28abc1f544e3943e8b" alt="ST_FrechetDistance" width="500" height="300" data-path="images/sql-functions/ST_FrechetDistance/ST_FrechetDistance.svg" />

## Signatures

```sql theme={"system"}
ST_FrechetDistance(g1: Geometry, g2: Geometry)
```

## Parameters

<ParamField body="g1" type="Geometry" required>
  The g1 value.
</ParamField>

<ParamField body="g2" type="Geometry" required>
  The g2 value.
</ParamField>

## Return type

<ResponseField type="Double">
  A numeric value.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_FrechetDistance(ST_GeomFromWKT('POINT (0 1)'), ST_GeomFromWKT('LINESTRING (0 0, 1 0, 2 0, 3 0, 4 0, 5 0)'))
```

```
5.0990195135927845
```
