﻿ Function ACos

# ACos

Calculates the arcCosine of a number.

ACos ( expression )

## Parameters

 expression Any value between -1 and 1 inclusive.

## Return Value

Returns the trigonometric arccosine of the number. Result is in radians.

## Remarks

ACos(x) is mathematically defined only for -1 < x < 1, so ACos() tends to return -1.#IND for other values of x.

## Example

### Example 1

```#include <MsgBoxConstants.au3>

Example()

Func Example()
; Assign a Local variable the arcCosine of 0.5.
Local \$fArcCos1 = ACos(0.5)

; Display the result.
MsgBox(\$MB_SYSTEMMODAL, "", \$fArcCos1 & " rad.")

; Assign a Local constant variable the approximate PI number.
Local Const \$PI = 3.141592653589793

; Assign a Local variable the formula to switch from radian to degree (equals to one radian in degree).
Local \$fRadToDeg = 180 / \$PI

; Assign a Local variable a number in degree.
Local \$fArcCos2 = \$fRadToDeg * ACos(-1)

; Display the result.
MsgBox(\$MB_SYSTEMMODAL, "", \$fArcCos2 & " deg.")
EndFunc   ;==>Example

```

### Example 2

```; Example of using ACos with degrees.
#include <Math.au3>
#include <MsgBoxConstants.au3>

Local \$fDegree = _Degree(ACos(-1))

MsgBox(\$MB_SYSTEMMODAL, Default, "ACos(-1) = " & \$fDegree & " degrees")

```