SIN
Returns the sine of an angle given in radians.
MySQL 8.4
SIN(angle)- angle
- Angle in radiansDOUBLE
Return value
A floating-point number from -1 to 1
Examples
Sine of a right angle
MySQL 8.4
SELECT SIN(PI() / 2);Sine of 30° rounded
MySQL 8.4
SELECT SIN(RADIANS(30)) AS raw,
ROUND(SIN(RADIANS(30)), 2) AS rounded;Details
To convert degrees to radians, use the RADIANS function: SIN(RADIANS(30)).
SIN(PI()) gives about 1e-16, not exactly 0.