Click or drag to resize

ACos Function

X#
Returns the arc cosine of a specified numeric expression.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION ACos(
	nExpression AS USUAL
) AS FLOAT
Request Example View Source

Parameters

nExpression
Type: Usual
Specifies a numeric expression whose arc cosine ACOS( ) returns. The value of nExpression can range from –1 through +1. The value returned by ACOS( ) ranges from 0 through pi (3.141592). The number of decimal places ACOS( ) returns is determined by SET DECIMALS. Use RTOD( ) to convert radians to degrees.

Return Value

Type: Float
Numeric
Remarks
The arc cosine is returned in radians.
Examples
 
X#
1CLEAR
2? RTOD(ACOS(0))  // Displays 90.00
3STORE -1 to gnArcAngle
4? RTOD(ACOS(gnArcAngle))  // Displays 180.00
5? RTOD(ACOS(SQRT(2)/2))  // Displays 45.00
See Also