Trusted answers to developer questions

harris910

The calculates the inverse cosine of a number. To be more specific, it returns the inverse cosine of a number in radians.

`acos()`

function`arc cosine`

functionFigure 1 shows the *mathematical* representation of the `acos()`

function, and Figure 2 shows the *visual* representation of the `acos()`

function.

To convert `radians`

to `degrees`

, use the following function:

```
rad2deg(angleInRadians)
```

```
acos(num)
```

This function requires a number as a parameter.

This function returns the `inverse cosine`

of a number (in radians) set as a parameter. The return value lies in the interval of `[0, pi]`

radians.

#this header for rad2deg() function use Math::Trig; #Positive number in radians $a = acos(0.5); print "acos(0.5): $a Radians\n"; #negative number in radians $b = acos(-0.5); print "acos(-0.5): $b Radians\n"; #applying acos() and then converting the result in radians to degrees #radians = 0.5 $c = rad2deg(acos(0.5)); print "acos(0.5): $c Degrees\n";

RELATED TAGS

perl

acos

math

communitycreator

CONTRIBUTOR

harris910

RELATED COURSES

View all Courses

Keep Exploring

Related Courses