Collections:
ATAN2() - 2-Argument Arctangent
How to calculate the angle of vector of X and Y using the ATAN2() function?
✍: FYIcenter.com
ATAN2(Y, X) is a MySQL built-in function that
calculates the angle of a given vector ending at (X, Y).
For example:
SELECT ATAN2(1, 0), ATAN2(0, 1), ATAN2(-1, 0); -- +--------------------+-------------+---------------------+ -- | ATAN2(1, 0) | ATAN2(0, 1) | ATAN2(-1, 0) | -- +--------------------+-------------+---------------------+ -- | 1.5707963267948966 | 0 | -1.5707963267948966 | -- +--------------------+-------------+---------------------+
Reference information of the ATAN2() function:
ATAN2(Y, X): ang Returns the arc tangent of the two variables X and Y. It is similar to calculating the arc tangent of Y / X, except that the signs of both arguments are used to determine the quadrant of the result. Arguments, return value and availability: Y, X: Required. The end point of the input vector. ang: Return value. The angle of the input vector. Available since MySQL 4.0.
Related MySQL functions:
⇒ BIN() - Converting Integer to Binary String
⇐ ATAN() - Arctangent Trigonometric Value
2023-11-15, 1088🔥, 0💬
Popular Posts:
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...
How To Convert Numeric Values to Integers in SQL Server Transact-SQL? Sometimes you need to round a ...
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...