w3resource

MySQL ASIN() function

ASIN() function

MySQL ASIN() returns the arc sine of a number. The function returns NULL when the value of the number is not between the ranges -1 to 1. It's a mathematical function that finds the angle whose sine is the specified number.

This function is useful in -

  • It's used to find angles in right triangles and is widely applied in fields like physics, engineering, and astronomy.
  • While SIN() takes an angle and returns its sine, ASIN() takes a sine value and returns the angle.
  • In geometry and applications dealing with coordinates and vectors, ASIN() is used to calculate angles between vectors or lines.
  • ASIN() is used in the calculation of arc lengths in circular segments, especially when dealing with circles and sectors.
  • In robotics and animation, ASIN() plays a crucial role in solving the inverse kinematics problem, which involves finding joint angles to position an end effector in a desired location.
  • In computer graphics and animation, ASIN() is used to determine the angles for smooth transitions between orientations of 3D objects.

Syntax:

ASIN(N)

Argument:

Name Description
N A number whose arch sine value is to be retrieved.

Syntax Diagram:

MySQL ASIN() Function - Syntax Diagram

MySQL Version: 8.0


Example:

Code:

SELECT ASIN(4);

Explanation:

The above MySQL statement will return NULL because the number specified as an argument is exceeding the range which can be accepted.

Output:

mysql> SELECT ASIN(4);
+---------+
| ASIN(4) |
+---------+
|    NULL | 
+---------+
1 row in set (0.02 sec)

Example: ASIN() function using fractional number

Code:

SELECT ASIN(.4);

Explanation:

The above MySQL statement will return the sine value of the number specified as an argument.

Output:

mysql> SELECT ASIN(.4);
+-------------------+
| ASIN(.4)          |
+-------------------+
| 0.411516846067488 | 
+-------------------+
1 row in set (0.01 sec)

All Mathematical Functions

Previous: ACOS()
Next: ATAN2()



Follow us on Facebook and Twitter for latest update.