MySQL SIN() Function: Find the sine of an angle

SIN() calculates the sine of an angle supplied in radians; use RADIANS() when your input is measured in degrees.

SIN(): Quick SQL Example

Run this SELECT query directly in MySQL or phpMyAdmin. It uses fixed inputs so you can verify the result without creating a table.

SELECT ROUND(SIN(RADIANS(30)), 2) AS sine_value;
sine_value
0.50
On this page — Show page sectionsHide page sections

More SQL Examples and Explanations

SIN(X) returns the sine of X, where X is in radians.

SELECT ROUND(SIN(PI()), 2); -- Output: 0.00
SELECT SIN(PI() / 2); -- Output: 1
SELECT ROUND(SIN(PI() / 3), 2); -- Output: 0.87

Syntax

SELECT SIN(X);

Use ROUND() for display precision and PI() for π.

SIN() with RADIANS()

SELECT SIN(RADIANS(0)); -- Output: 0
SELECT SIN(RADIANS(90)); -- Output: 1
SELECT ROUND(SIN(RADIANS(180)), 2); -- Output: 0.00

How to Interpret the Result

Floating-point precision can produce very small values instead of an exact zero.

Common Question

Why does SIN(90) not return 1?
The input 90 is treated as radians. Use SIN(RADIANS(90)) for 90 degrees.

↑ Back to top




Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer