SIN
Example
Section titled “Example”SELECT SIN(PI()/4);Output
Section titled “Output”0.70710678118655Explanation
Section titled “Explanation”The SIN() function in MySQL returns the sine of an angle provided in radians. The PI() function returns the value of PI. Thus, SIN(PI()/4) calculates the sine of 45 degrees. The output 0.70710678118655 is the result of this calculation.
Example
Section titled “Example”SELECT SIN(1);Output
Section titled “Output”0.8414709848078965Explanation
Section titled “Explanation”The SIN function in PostgreSQL calculates the sine of a number. In the example above, the sine of 1 was computed.
Example
Section titled “Example”DECLARE @Value FLOAT;SET @Value = PI()/4;SELECT SIN(@Value) as SinValue;Output
Section titled “Output”SinValue----------------------0.707106781186547Explanation
Section titled “Explanation”In the example, a variable @Value is declared and initialized to PI()/4. SIN(@Value) function is called which calculates the sine of the given value. The result is then selected and displayed as SinValue, which is 0.707106781186547 in this case.
Example
Section titled “Example”SELECT SIN(radians(45)) FROM dual;Output
Section titled “Output”0.707106781Explanation
Section titled “Explanation”The above SQL command calculates the sine of 45 degrees. The radians function is used to convert 45 degrees to radians before SIN is called.
Example
Section titled “Example”SELECT SIN(1);Output
Section titled “Output”0.8414709848078965Explanation
Section titled “Explanation”The SIN function in SQLite returns the sine of a number. In the given example, SIN(1) returns 0.8414709848078965, which is the sine of 1.