Friday, December 20, 2024

MySQL RADIANS() Function

 The RADIANS() function in MySQL is used to convert an angle from degrees to radians. This function is particularly useful when you are working with trigonometric calculations, as most trigonometric functions (like SIN(), COS(), and TAN()) expect input values in radians.

Syntax:

RADIANS(degrees)
  • degrees: The angle in degrees that you want to convert to radians.

Example:

SELECT RADIANS(180);  -- Returns 3.14159265358979

In this example, 180 degrees is converted to π radians, which is approximately 3.14159265358979.

No comments:

Post a Comment