X is in Radian
COS() with PI()mathematical constant PI() (π) value is 3.141593
We used ROUND() to show only two decimal places.
COS() with RADIANS
SELECT COS(RADIANS(0)); // Ouput is 1 SELECT ROUND(COS(RADIANS(90)),2); // Output is 0.00 SELECT COS(RADIANS(180)); // Output is -1
This article is written by plus2net.com team.
▼ More on Math functions in SQL