ACOS
ACOS(X)Where X is a numeric value between -1 and 1, representing the cosine of the angle.
Section titled “ACOS(X)Where X is a numeric value between -1 and 1, representing the cosine of the angle.”- x: A numeric value ranging between -1 and 1 that represents the cosine of the angle for which the arc cosine is computed in MySQL’s ACOS(X) function.
Example
Section titled “Example”SELECT ACOS(0.5);Output
Section titled “Output”1.0471975511966Explanation
Section titled “Explanation”This example demonstrates the ACOS function in MySQL. ACOS function returns the arc cosine of a number; applied to 0.5, it returns approximately 1.0471975511966.
ACOS(double precision) returns double precision
Section titled “ACOS(double precision) returns double precision”- double precision: This parameter represents a double precision floating-point number for which you are trying to calculate the arc cosine. The value should be within the range of -1 to 1. If the value is outside this range, the function will return “NaN”.
Example
Section titled “Example”SELECT ACOS(0.5);Output
Section titled “Output”1.0471975511966Explanation
Section titled “Explanation”The ACOS function in PostgreSQL returns the arc cosine of a number. In the example, ACOS(0.5) returns 1.0471975511966, which is radian value of the arc cosine of 0.5.
ACOS(float_expression)
Section titled “ACOS(float_expression)”- float_expression: This parameter represents a floating-point numeric value from which SQL Server derives the arccosine, or inverse cosine. Any number between -1 and 1 can be used for this parameter. If the number falls outside this range, SQL Server returns NULL. The datatype for float_expression must be able to implicitly convert to float.
Example
Section titled “Example”SELECT ACOS(0.5) AS AcosValue;Output
Section titled “Output”0.523598775598299Explanation
Section titled “Explanation”The ACOS() function returns the arc cosine of a number. In the provided example, the ACOS of 0.5 is calculated. The output value is in radians.
ACOS(numeric_value)
Section titled “ACOS(numeric_value)”- numeric_value: This is the numeric value for which the Arc Cosine value is to be calculated. It should lie in the range of -1 to 1 because acos returns NULL if the absolute value of the argument exceeds 1.
Example
Section titled “Example”SELECT ACOS(0.5) FROM dual;Output
Section titled “Output”1.047197551Explanation
Section titled “Explanation”In this example, the ACOS function returns the arc cosine of 0.5. The return value is in the range of 0 to π radians. The value 1.047197551 is approximately 60 degrees which is the cosine inverse of 0.5.
ACOS(X)
Section titled “ACOS(X)”- x: This is the numeric value for which the arccosine is to be calculated. The value of X must lie in the range -1 to +1.
Example
Section titled “Example”SELECT ACOS(0.5);Output
Section titled “Output”1.0471975511966Explanation
Section titled “Explanation”The ACOS function in SQLite computes the arc cosine of a given number. In this example, it computes the arc cosine of 0.5. The output, 1.0471975511966, is the computed value in radians.