ACos

Description

Calculates the arccosine of an angle.

Syntax

ACos ( n )

Argument

Description

n

The ratio of the lengths of two sides of a triangle for which you want a corresponding angle (in radians). The ratio must be a value between -1 and 1.


Return value

Double.

Returns the arccosine of n.

Examples

This statement returns 0:

ACos(1)

This statement returns 3.141593 (rounded to six places):

ACos(-1)

This statement returns 1.000000 (rounded to six places):

ACos(.540302)

This code in the Clicked event of a button catches a runtime error that occurs when an arccosine is taken for a user-entered value -- passed in a variable -- that is outside of the permitted range:

Double ld_num
ld_num = Double (sle_1.text)
 
TRY
sle_2.text = string (acos (ld_num))
CATCH (runtimeerror er)
   MessageBox("Runtime Error", er.getmessage())
END TRY

See also

Cos

ASin

ATan

ACos method for DataWindows in the section called “ACos” in DataWindow Reference