The ASIN function in Oracle SQL is a trigonometric function that stands for Arc Sine. It is the opposite of the SIN (Sine) function. While SIN takes an angle and gives you a ratio, ASIN takes a ratio and gives you back the angle.
The angle is returned in radians, which is the standard mathematical way to measure angles (as opposed to degrees).
What is the ASIN Function in Oracle?
The ASIN function is used to find the angle whose sine is a given number.
- Input Range: The input number
nmust be between -1 and 1. This is because the sine of any angle always falls within this range. - Output Range: The function returns the angle as a number in radians, which will always be between
-pi/2andpi/2(approximately -1.5708 to 1.5708).
This function is typically used in engineering, scientific, and mathematical calculations where you need to solve for an angle based on a known sine ratio.
ASIN Function Syntax
The syntax for ASIN is very simple:
ASIN(n)
Let's break that down:
n: The number (or numeric column) for which you want to find the arc sine. This value must be between -1 and 1.
Oracle ASIN Function Examples
Here are two practical examples of how to use ASIN.
Example 1: Finding the Arc Sine of 0.5
In trigonometry, the sine of a 30-degree angle is 0.5. In radians, 30 degrees is pi / 6 (approx 0.5236). Let's see what ASIN returns.
Query:
SELECT
ASIN(0.5) AS "ArcSine_of_0.5"
FROM DUAL;
Result:
ArcSine_of_0.5
--------------
.523598776
This is the angle (in radians) whose sine is 0.5.
Example 2: Finding the Arc Sine of 1
The sine of a 90-degree angle (or pi / 2 radians) is 1.
Query:
SELECT
ASIN(1) AS "ArcSine_of_1"
FROM DUAL;
Result:
ArcSine_of_1
------------
1.57079633
This is the value of pi / 2 (in radians), which is the angle whose sine is 1.
