Skip to content
Related Articles
ASIN(), ACOS() and ATAN() Function in MariaDB
• Last Updated : 01 Oct, 2020

1. ASIN Function :
In MariaDB, the ASIN function is used for finding arc sine of a number. In this function, a number will be passed as a parameter and this function will return the arcsine of that number. The function will return valid output only if the number is in the range of -1 to 1, otherwise, it will return NULL as output.

Syntax :

`ASIN(number)`

Parameter : Required. A numeric value.
number : A number used to calculate the arcsine. The range of number must in the range -1 to 1.

Example-1 :

`SELECT ASIN(1);`

Output :

`1.5707963267948966`

Example-2 :

`SELECT ASIN(2.3);`

Output :

`NULL`

Example-3 :

`SELECT ASIN(0.41);`

Output :

`0.42245406218675574`

2. ACOS Function :
In MariaDB, the ACOS function is used for finding arc cosine of a number. In this function, a number will be passed as a parameter and this function will return the arc cosine of that number. The function will return valid output only if the number is in the range of -1 to 1, otherwise, it will return NULL as output.

Syntax :

`ACOS(number)`

Parameter : Required. A numeric value.
number : A number used to calculate the arc cosine. The range of number must in the range -1 to 1.

Example-1 :

`SELECT ACOS(-0.6);`

Output :

`2.214297435588181`

Example-2 :

`SELECT ACOS(1);`

Output :

`0`

Example-3 :

`SELECT ACOS(1.9);`

Output :

`NULL`

3. ATAN Function :
In MariaDB, the ATAN function is used for finding arc tangent of a number or arc tangent of n and m. In this function, a number will be passed as a parameter or n and m will be passed for the second type of syntax. this function will return the arc tangent of that number. When the second type of syntax is used then the sign of m, n is used for deciding the quadrant for the result.

Syntax-1 :

`ATAN(number)`

Parameter : Required. A numeric value.
number : A number used to calculate the arc tangent.

Syntax-2 :

`ATAN(n, m)`

Parameters : Required. Two numeric values.
n, m : Two values used to calculate the arc tangent.

Example-1 :

`SELECT ATAN(-1.4);`

Output :

`-0.9505468408120751`

Example-2 :

`SELECT ATAN(1, 3);`

Output :

`0.3217505543966422`

Example-3 :

`SELECT ATAN(0.6);`

Output :

`0.5404195002705842`

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up