Trusted answers to developer questions

harris910

The function in R returns the

`acos()`

`arc cosine`

function`acos()`

returns the inverse cosine of a number in Figure 1 below shows the mathematical representation of the `acos()`

function.

Figure 2 below shows the visual representation of the `acos()`

function.

To convert `radians`

to `degrees`

, use the following formula:

```
degrees = radians * ( 180.0 / pi )
```

```
acos(num)
```

The `acos()`

function requires a number as a parameter.

`acos()`

returns the inverse cosine of the number that is sent as a parameter. The return value lies in interval `[0, pi]`

radians.

#Positive number in radians a <- acos(0.5); print(paste0("acos(0.5): ", a, " radians")) #negative number in radians b <- acos(-0.5); print(paste0("acos(-0.5): ", b, " radians")) #applying acos() and then converting the result in radians to degrees #radians = 0.5 c <- acos(0.5) * (180.0 / pi); print(paste0("acos(0.5): ", c, " degrees"))

RELATED TAGS

r

math

acos

communitycreator

CONTRIBUTOR

harris910

RELATED COURSES

View all Courses

Keep Exploring

Related Courses