Name

ST_Azimuth — Returns the azimuth between two points.

Synopsis

geometry ST_Azimuth(bytea PointA, bytea PointB);

Alias

Azimuth

Description

Returns the azimuth between two points. Azimuth is defined as a horizontal angle measured clockwise from North to a base direction line. The azimuth angle is returned in radians.

[Note]

Input geometries must be points.

Coordinate Dimensions
2D3DM

-

-

Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_Azimuth(ST_GeomFromText('POINT(0 0)'),ST_GeomFromText('POINT(5 0)')) as anglerad;
    anglerad
-----------------
 1.5707963267949

SELECT ST_Azimuth(ST_GeomFromText('POINT(0 0)'),ST_GeomFromText('POINT(5 0)'))*180/pi() as angledegrees;
 angledegrees
--------------
           90

Related functions