# Azimuth calculation in QGIS 3.10

I am calculating the azimuth between two points whose position is defined in WGS84 coordinates. If I Open Attribute Table -> Open Field Calculator and ask for

``````degrees(
azimuth(
make_point(6.020323,47.248690),
make_point(6.083703,47.242157)
)
)
``````

I get 95.885° degrees which is inconsistent with the manual calculation

``````atan2(sin(delta_lon)*cos(lat2), cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(delta_lon))
``````

or with the result provided by the French Geographic Institute (Géoportail) web site.

However, if following Azimuth calculation, extending lines I run in the Python Console:

``````p1 = QgsPointXY(6.020323,47.248690)
p2 = QgsPointXY(6.083703,47.242157)
d = QgsDistanceArea()
d.setEllipsoid('WGS84')
d.bearing(p1,p2)*180/3.1415926535
``````

then I get the correct result of 98.584. Could someone enlighten me as to why the first method provides an erroneous result?

The `azimuth()` function calculates the Cartesian angle y-axis-based clockwise in the Cartesian plane of the coordinate reference system in which are expressed the coordinates of the given points.
The `QgsDistanceArea.bearing()` function, instead, calculates the geodesic bearing angle True-North-based clockwise on the specified ellipsoid (orthodromic) from the given WGS 84 geographical coordinates, or from the coordinates expressed in another coordinate reference system just setting it with the `QgsDistanceArea` function `setSourceCrs()`