Calculates the arc tangent of y/x, taking the quadrant into account. The result is in radians, ranging from -π to π.
DOUBLEDiperbarui: 13 Jun 2026ATAN2(y, x)Y coordinate
X coordinate
1 SELECT DEGREES(ATAN2(1, 1)) AS angle;
Angle to point (1,1) equals 45 degrees.
1 SELECT DEGREES(ATAN2(-1, -1)) AS angle;
Angle to point (-1,-1) equals -135 degrees.
1 SELECT DEGREES(ATAN2( 2 SIN(RADIANS(lon2-lon1)) * COS(RADIANS(lat2)), 3 COS(RADIANS(lat1)) * SIN(RADIANS(lat2)) - 4 SIN(RADIANS(lat1)) * COS(RADIANS(lat2)) * COS(RADIANS(lon2-lon1)) 5 )) AS bearing;
Calculates the bearing between two coordinates.
Sudah paham ATAN2? Latih langsung di browser
Latihan interaktif, langsung di browser.
DEGREES