> ## 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_Angle

Computes and returns the angle between two vectors represented by the provided points or linestrings.

There are three variants possible for ST\_Angle:

Computes the angle formed by vectors represented by point1 - point2 and point3 - point4

Computes the angle formed by vectors represented by point2 - point1 and point2 - point3

Computes the angle formed by vectors S1 - E1 and S2 - E2, where S and E denote start and end points respectively

<Note>
  If any other geometry type is provided, ST\_Angle throws an IllegalArgumentException.
  Additionally, if any of the provided geometry is empty, ST\_Angle throws an IllegalArgumentException.
</Note>

<Note>
  If a 3D geometry is provided, ST\_Angle computes the angle ignoring the z ordinate, equivalent to calling ST\_Angle for corresponding 2D geometries.
</Note>

<Tip>
  ST\_Angle returns the angle in radian between 0 and 2\Pi. To convert the angle to degrees, use [ST\_Degrees](/reference/wherobots-db/geometry-data/measurement/ST_Degrees).
</Tip>

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

## Signatures

```sql theme={"system"}
ST_Angle(p1, p2, p3, p4) | ST_Angle(p1, p2, p3) | ST_Angle(line1, line2)
```

## Parameters

<ParamField body="p1" type="Geometry" required>
  The first point (or first LineString in the two-LineString variant).
</ParamField>

<ParamField body="p2" type="Geometry" required>
  The second point (or second LineString in the two-LineString variant).
</ParamField>

<ParamField body="p3" type="Geometry">
  The third point (used in the 3-point and 4-point variants).
</ParamField>

<ParamField body="p4" type="Geometry">
  The fourth point (used in the 4-point variant only).
</ParamField>

## Return type

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

## Examples

```sql theme={"system"}
SELECT ST_Angle(ST_GeomFromWKT('POINT(0 0)'), ST_GeomFromWKT('POINT (1 1)'), ST_GeomFromWKT('POINT(1 0)'), ST_GeomFromWKT('POINT(6 2)'))
```

```
0.4048917862850834
```

```sql theme={"system"}
SELECT ST_Angle(ST_GeomFromWKT('POINT (1 1)'), ST_GeomFromWKT('POINT (0 0)'), ST_GeomFromWKT('POINT(3 2)'))
```

```
0.19739555984988044
```

```sql theme={"system"}
SELECT ST_Angle(ST_GeomFromWKT('LINESTRING (0 0, 1 1)'), ST_GeomFromWKT('LINESTRING (0 0, 3 2)'))
```

```
0.19739555984988044
```
